Skip to content

Commit

Permalink
api: Add default values to parameters.
Browse files Browse the repository at this point in the history
Added default values to different parameters in the api.yaml file. These
include default hierarchy values for root regions, region information,
subregions, parent regions, region geometry, region search, and sibling
regions. Also, made the 'query' parameter required for region search.

Signed-off-by: Nikolay Martyanov <[email protected]>
  • Loading branch information
OhmSpectator committed Jan 4, 2024
1 parent 9d15c80 commit a79b8a1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ paths:
If not specified, the default hierarchy is used.
schema:
type: integer
default: 1
responses:
'200':
description: List of root regions
Expand Down Expand Up @@ -50,6 +51,7 @@ paths:
If not specified, the default hierarchy is used.
schema:
type: integer
default: 1
responses:
'200':
description: Region information
Expand Down Expand Up @@ -79,6 +81,7 @@ paths:
description: Whether to retrieve all nested subregions or just the immediate subregions.
schema:
type: boolean
default: false
- name: hierarchyId
in: query
required: false
Expand All @@ -87,6 +90,7 @@ paths:
If not specified, the default hierarchy is used.
schema:
type: integer
default: 1
responses:
'200':
description: List of subregions
Expand Down Expand Up @@ -121,6 +125,7 @@ paths:
If not specified, the default hierarchy is used.
schema:
type: integer
default: 1
responses:
'200':
description: List of parent regions, including the region itself, in order
Expand Down Expand Up @@ -150,6 +155,7 @@ paths:
description: Whether to resolve empty geometries by aggregating the geometries of the subregions.
schema:
type: boolean
default: false
- name: hierarchyId
in: query
required: false
Expand All @@ -158,6 +164,7 @@ paths:
If not specified, the default hierarchy is used.
schema:
type: integer
default: 1
responses:
'200':
description: Geometry of the region, in GeoJSON format, always a MultiPolygon
Expand Down Expand Up @@ -195,6 +202,7 @@ paths:
summary: Search for regions by name
parameters:
- name: query
required: true
in: query
schema:
type: string
Expand All @@ -206,6 +214,7 @@ paths:
If not specified, the default hierarchy is used.
schema:
type: integer
default: 1
responses:
'200':
description: List of regions matching the query
Expand Down Expand Up @@ -237,6 +246,7 @@ paths:
If not specified, the default hierarchy is used.
schema:
type: integer
default: 1
responses:
'200':
description: List of sibling regions, including the region itself
Expand Down

0 comments on commit a79b8a1

Please sign in to comment.