Last active
April 6, 2022 05:31
-
-
Save yohangdev/2efb1f26f452d059643fb7ea00c15a10 to your computer and use it in GitHub Desktop.
Jabar Coding Camp - Backend Challenge - API Specification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swagger: "2.0" | |
info: | |
description: "Ini adalah dokumentasi API Specification untuk challenge Get Nearby Places." | |
version: "1.0.0" | |
title: "Get Nearby Places" | |
host: "localhost:8000" | |
schemes: | |
- "http" | |
- "https" | |
paths: | |
/search: | |
get: | |
summary: "Melakukan pencarian tempat/places dengan lokasi terdekat dari sebuah titik koordinat" | |
consumes: | |
- "application/json" | |
produces: | |
- "application/json" | |
parameters: | |
- in: "query" | |
name: "latitude" | |
type: "number" | |
format: "float" | |
required: true | |
description: "Posisi GPS Latitude lokasi user saat ini." | |
- in: "query" | |
name: "longitude" | |
type: "number" | |
format: "float" | |
required: true | |
description: "Posisi GPS Longitude lokasi user saat ini." | |
- in: "query" | |
name: "category_id" | |
type: "integer" | |
description: "Filter berdasarkan Kategori." | |
responses: | |
'200': | |
description: "Daftar tempat/places terdekat dengan lokasi terdekat." | |
schema: | |
$ref: '#/definitions/SearchResponse' | |
definitions: | |
SearchResponse: | |
type: "object" | |
properties: | |
data: | |
$ref: '#/definitions/ArrayOfPlaces' | |
total: | |
type: "number" | |
example: 2 | |
ArrayOfPlaces: | |
type: "array" | |
items: | |
$ref: '#/definitions/Place' | |
example: | |
- id: 1 | |
name: "Puskesmas Antapani 1" | |
category_id: 2 | |
city_name: "Kota Bandung" | |
district_name: "Kecamatan Antapani" | |
latitude: -6.9131547622849965 | |
longitude: 107.66358207489387 | |
- id: 2 | |
name: "Puskesmas Antapani 2" | |
category_id: 2 | |
city_name: "Kota Bandung" | |
district_name: "Kecamatan Antapani" | |
latitude: -6.916428901401269 | |
longitude: 107.66058554494842 | |
Place: | |
type: "object" | |
properties: | |
id: | |
type: "integer" | |
name: | |
type: "string" | |
category_id: | |
type: "integer" | |
city_name: | |
type: "string" | |
district_name: | |
type: "string" | |
latitude: | |
type: "number" | |
format: "float" | |
longitude: | |
type: "number" | |
format: "float" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment