Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
#157-fixed swagger schema
Browse files Browse the repository at this point in the history
  • Loading branch information
bariela committed Oct 10, 2022
1 parent 4049a24 commit 1e1ccff
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
17 changes: 14 additions & 3 deletions api/src/openapi/apiSchema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ paths:
type: array
items:
type: string
example: Bali
allowReserved: true
example: Bali
- name: attributeId
in: query
required: false
Expand All @@ -43,6 +44,7 @@ paths:
items:
type: string
example: "A1_recovery rate (%)"
allowReserved: true
- name: attributeIdCategory
in: query
required: false
Expand All @@ -52,6 +54,7 @@ paths:
items:
type: string
example: "dailyCovid19Cases"
allowReserved: true
- name: offset
in: query
required: false
Expand Down Expand Up @@ -93,6 +96,7 @@ paths:
schema:
type: string
example: "A1_recovery rate (%)"
allowReserved: true
responses:
"200":
description: Successful response
Expand All @@ -108,6 +112,7 @@ paths:
schema:
type: string
example: "Population on admin2 level"
allowReserved: true
responses:
"200":
description: Successful response
Expand Down Expand Up @@ -184,12 +189,14 @@ paths:
type: string
description: attributeId
required: true
allowReserved: true
- in: path
name: property
schema:
type: string
description: property on attribute
required: true
allowReserved: true
responses:
"200":
description: Successful response
Expand Down Expand Up @@ -260,6 +267,7 @@ paths:
type: string
description: name of property
required: true
allowReserved: true
responses:
200:
description: Successful response
Expand All @@ -281,6 +289,7 @@ paths:
type: string
description: name of property
required: true
allowReserved: true
responses:
200:
description: Successfull response
Expand All @@ -302,6 +311,7 @@ paths:
type: string
description: name of property
required: true
allowReserved: true
responses:
200:
description: Successful resposne
Expand Down Expand Up @@ -335,14 +345,15 @@ paths:
schema:
type: string
description: Projection for coordinates values.
allowReserved: true
responses:
200:
description: Successful response

/api/dataLayers:
get:
summary: Gets static layers data
description: Gets static layers data for display in openlayers map
summary: Gets data from layers data
description: Gets data from layers data for display in openlayers map
responses:
"200":
description: Successful response
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ router.get(
'/',
utils.forwardError(async (req, res) => {
const { limit, offset, dateStart, dateEnd, attributeIdCategory, featureId, latestValues } = req.query;
const attributeId = req.query.attributeId ? decodeURIComponent(req.query.attributeId) : req.query.attributeId;
const { attributeId } = req.query;
const { items, count } = await getAttributes(
{ attributeId, attributeIdCategory, featureId, dateStart, dateEnd, latestValues },
{ limit, offset },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const boxReloadVectorSourceLoader = (layerData, handleIsLoading, title) => {
let baseUrl;
let escapedAttribute;
if (layerData.attribute) {
escapedAttribute = encodeURIComponent(layerData.attribute);
escapedAttribute = layerData.attribute;
}
if (layerData.geoDataUrl) {
baseUrl = `${layerData.geoDataUrl}?`;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/ol/staticLayers/vectorSourceLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const vectorSourceLoader = (layerData, handleIsLoading, title, type) => {
let attributes = [];

if (layerData.attribute) {
const escapedAttribute = encodeURIComponent(layerData.attribute);
const escapedAttribute = layerData.attribute;
if (vectorSource.get('sliderDate') && layerData.layerOptions.timeseries) {
const searchParams = new URLSearchParams();
searchParams.append('attributeId', escapedAttribute);
Expand Down

0 comments on commit 1e1ccff

Please sign in to comment.