You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This allows us to load all data from the same place.
If we add the municipality data to the API, we could get better OpenAPI docs which would make it easier to get AI:s to generate frontend code using the expected data.
This would also make it easier for others outside of Klimatkollen to use the open datasets that we've compiled and processed.
Initial tasks
GET /municipalities - list all climate-data.json
GET /municipalities/:municipalitySlug (or ID) - details for specific municipality
Create a municipalityService which supports getMunicipalities() and getMunicipality(name: string)
In the municipalityService, load climate-data.json and keep a Map in memory to allow returning company data quickly.
Implement the cache() plugin to make the client save responses.
Generate zod schemas based on the JSON data, for example with https://app.quicktype.io/. Use these both to parse the incoming data from the Python data pipeline when garbo starts, to ensure we get the expected data format. Also define the same schemas for the API endpoints response schemas. This will also add this to the API documentation.
The text was updated successfully, but these errors were encountered:
Greenheart
changed the title
Consider adding municipality data to the API to publish all data in the same place
Add GET endpoints to load municipality data via the API
Jan 22, 2025
This allows us to load all data from the same place.
If we add the municipality data to the API, we could get better OpenAPI docs which would make it easier to get AI:s to generate frontend code using the expected data.
This would also make it easier for others outside of Klimatkollen to use the open datasets that we've compiled and processed.
Initial tasks
GET /municipalities
- list allclimate-data.json
GET /municipalities/:municipalitySlug
(or ID) - details for specific municipalityImplementation ideas
municipalityService
which supportsgetMunicipalities()
andgetMunicipality(name: string)
municipalityService
, loadclimate-data.json
and keep aMap
in memory to allow returning company data quickly.cache()
plugin to make the client save responses.The text was updated successfully, but these errors were encountered: