Add metadata discovery endpoints for curves and exports#1774
Conversation
|
Smart thinking with the registry, as the exports are not available as models. A few questions:
Although I like the direction you are taking, this might need some more thought and design? A first step could be a hardcoded |
|
I tend to agree this maybe needs more thought? Like maybe the endpoints should all be discoverable in a consistent pattern, not just the curves/exports? What is the logical separation between these two (the shape is an obvious answer but maybe it requires more refinement). |
Context
PyETM previously hard-coded the list of available curves and exports. Any new output required changes in pyetm too. These endpoints let pyetm discover available outputs at runtime so a new curve or export can be added to ETEngine without cascading changes.
Implemented changes
GET /api/v3/curves/metadatareturning all registered hourly output curves with their name, type, and descriptionGET /api/v3/exports/metadatareturning all registered annual exports with their name and descriptionCurveMetadataRegistry, a registry populated at startup via an initialiser; curves and exports register themselves in their respective controllersRelated
Goes with this pyetm PR and this documentation PR
Checklist