Skip to content

feat(schema): derive JsonSchema for multi-network models - #900

Merged
jetuk merged 1 commit into
pywr:mainfrom
Nexsys-Analytics:feat/multi-network-schema-derives
Oct 9, 2026
Merged

jetuk merged 1 commit into
pywr:mainfrom
Nexsys-Analytics:feat/multi-network-schema-derives

Conversation

@Mearman

@Mearman Mearman commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

pywr-cli export-schema writes the JSON Schema for ModelSchema, but the multi-network model types (MultiNetworkModelSchema and the types it contains) do not derive JsonSchema, so a multi-network file has no schema to validate against and cannot be part of a combined schema.

This adds the derive on those four types and nothing else, so a schema can be generated for them with schema_for! the same way as for ModelSchema. No behaviour changes: the derive only adds a trait implementation.

It is needed by #901, which uses it to export one schema for v1 and v2 model files. This change does not depend on that work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants