Completed countries/regions/cities
This commit is contained in:
@@ -221,3 +221,272 @@ paths:
|
||||
description: "No token provided"
|
||||
404:
|
||||
description: "Country not found"
|
||||
|
||||
/countries:
|
||||
get:
|
||||
tags:
|
||||
- "countries"
|
||||
summary: "Get all countries"
|
||||
produces:
|
||||
- application/json
|
||||
parameters:
|
||||
- in: header
|
||||
name: "Authorization"
|
||||
required: true
|
||||
type: string
|
||||
description: Authorization Token
|
||||
responses:
|
||||
200:
|
||||
description: "OK"
|
||||
401:
|
||||
description: "No token provided"
|
||||
|
||||
/countries/{country}:
|
||||
get:
|
||||
tags:
|
||||
- "countries"
|
||||
summary: "Get a single country"
|
||||
produces:
|
||||
- application/json
|
||||
parameters:
|
||||
- name: country
|
||||
in: path
|
||||
description: "Required Country"
|
||||
type: string
|
||||
required: true
|
||||
- in: header
|
||||
name: "Authorization"
|
||||
required: true
|
||||
type: string
|
||||
description: Authorization Token
|
||||
responses:
|
||||
200:
|
||||
description: "OK"
|
||||
401:
|
||||
description: "No token provided"
|
||||
404:
|
||||
description: "Country not found"
|
||||
|
||||
delete:
|
||||
tags:
|
||||
- "countries"
|
||||
summary: "Delete a specific country"
|
||||
description: ""
|
||||
parameters:
|
||||
- name: country
|
||||
in: path
|
||||
description: "Country to delete"
|
||||
type: string
|
||||
required: true
|
||||
- in: header
|
||||
name: "Authorization"
|
||||
required: true
|
||||
type: string
|
||||
description: Authorization Token
|
||||
responses:
|
||||
204:
|
||||
description: "OK, country was deleted"
|
||||
401:
|
||||
description: "No token provided"
|
||||
404:
|
||||
description: "Country does not exist"
|
||||
405:
|
||||
description: "Country has regions, cannot be deleted"
|
||||
|
||||
put:
|
||||
tags:
|
||||
- "countries"
|
||||
summary: "Update or create a country"
|
||||
consumes:
|
||||
- "application/x-www-form-urlencoded"
|
||||
produces:
|
||||
- text/plain
|
||||
parameters:
|
||||
- name: country
|
||||
in: path
|
||||
description: "Country"
|
||||
type: string
|
||||
required: true
|
||||
- in: formData
|
||||
name: name
|
||||
required: true
|
||||
type: string
|
||||
description: The region's new name.
|
||||
- in: header
|
||||
name: "Authorization"
|
||||
required: true
|
||||
type: string
|
||||
description: Authorization Token
|
||||
responses:
|
||||
204:
|
||||
description: "OK, coutry was updated"
|
||||
400:
|
||||
description: "Name missing, country not updated"
|
||||
401:
|
||||
description: "No token provided"
|
||||
|
||||
/cities:
|
||||
post:
|
||||
tags:
|
||||
- "cities"
|
||||
summary: "Add a city"
|
||||
consumes:
|
||||
- "application/x-www-form-urlencoded"
|
||||
produces:
|
||||
- text/plain
|
||||
parameters:
|
||||
- in: formData
|
||||
name: name
|
||||
required: true
|
||||
type: string
|
||||
description: The new city's name.
|
||||
- in: formData
|
||||
name: latitude
|
||||
required: true
|
||||
type: number
|
||||
description: The new city's latitude.
|
||||
- in: formData
|
||||
name: longitude
|
||||
required: true
|
||||
type: number
|
||||
description: The new city's longitude.
|
||||
- in: formData
|
||||
name: population
|
||||
required: true
|
||||
type: number
|
||||
description: The new city's population.
|
||||
- in: formData
|
||||
name: countryCode
|
||||
required: true
|
||||
type: string
|
||||
description: The new city's country.
|
||||
- in: formData
|
||||
name: regionCode
|
||||
required: true
|
||||
type: string
|
||||
description: The new city's region.
|
||||
- in: header
|
||||
name: "Authorization"
|
||||
required: true
|
||||
type: string
|
||||
description: Authorization Token
|
||||
responses:
|
||||
201:
|
||||
description: "OK, created"
|
||||
400:
|
||||
description: "Name missing, city not created"
|
||||
401:
|
||||
description: "No token provided"
|
||||
403:
|
||||
description: "Region not found, city not created"
|
||||
409:
|
||||
description: "Other failure, city not created"
|
||||
|
||||
/cities/{cityId}:
|
||||
get:
|
||||
tags:
|
||||
- "cities"
|
||||
summary: "Get a specific city"
|
||||
produces:
|
||||
- application/json
|
||||
parameters:
|
||||
- name: cityId
|
||||
in: path
|
||||
description: "Id of the city"
|
||||
type: number
|
||||
required: true
|
||||
- in: header
|
||||
name: "Authorization"
|
||||
required: true
|
||||
type: string
|
||||
description: Authorization Token
|
||||
responses:
|
||||
200:
|
||||
description: "OK"
|
||||
401:
|
||||
description: "No token provided"
|
||||
404:
|
||||
description: "City not found"
|
||||
|
||||
delete:
|
||||
tags:
|
||||
- "cities"
|
||||
summary: "Delete a specific city"
|
||||
description: ""
|
||||
parameters:
|
||||
- name: cityId
|
||||
in: path
|
||||
description: "Id of the city"
|
||||
type: number
|
||||
required: true
|
||||
- in: header
|
||||
name: "Authorization"
|
||||
required: true
|
||||
type: string
|
||||
description: Authorization Token
|
||||
responses:
|
||||
204:
|
||||
description: "OK, city was deleted"
|
||||
401:
|
||||
description: "No token provided"
|
||||
404:
|
||||
description: "City does not exist"
|
||||
|
||||
put:
|
||||
tags:
|
||||
- "cities"
|
||||
summary: "Update a specific city"
|
||||
consumes:
|
||||
- "application/x-www-form-urlencoded"
|
||||
produces:
|
||||
- text/plain
|
||||
parameters:
|
||||
- name: cityId
|
||||
in: path
|
||||
description: "Id of the city"
|
||||
type: number
|
||||
required: true
|
||||
- in: formData
|
||||
name: name
|
||||
required: true
|
||||
type: string
|
||||
description: The new city's name.
|
||||
- in: formData
|
||||
name: latitude
|
||||
required: true
|
||||
type: number
|
||||
description: The new city's latitude.
|
||||
- in: formData
|
||||
name: longitude
|
||||
required: true
|
||||
type: number
|
||||
description: The new city's longitude.
|
||||
- in: formData
|
||||
name: population
|
||||
required: true
|
||||
type: number
|
||||
description: The new city's population.
|
||||
- in: formData
|
||||
name: countryCode
|
||||
required: true
|
||||
type: string
|
||||
description: The new city's country.
|
||||
- in: formData
|
||||
name: regionCode
|
||||
required: true
|
||||
type: string
|
||||
description: The new city's region.
|
||||
- in: header
|
||||
name: "Authorization"
|
||||
required: true
|
||||
type: string
|
||||
description: Authorization Token
|
||||
responses:
|
||||
204:
|
||||
description: "OK, city was updated"
|
||||
400:
|
||||
description: "Name missing, city not updated"
|
||||
401:
|
||||
description: "No token provided"
|
||||
404:
|
||||
description: "City not found"
|
||||
|
||||
Reference in New Issue
Block a user