The generated types for metadata and resource.*.metadata were broken because the code generator ignored the additionalProperties and instead generated concrete types without any support for additional metadata entries.
Unfortunately we need the best of both worlds: an arbitrary map, while still checking for required properties during validation.
To fix this we generate the types from a 'modified' version of the spec in which we treat it like a generic map[string]interface{}. This 'modified' version is generated from a Makefile which also allows us to better codify the update-schema process.
The validation continues to use the raw spec file which can validate the required fields within the arbitrary object.
This library will then be imported into score-compose and any other score implementations that can consume it.
Types of changes
[X] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[X] New chore (expected functionality to be implemented)
Checklist:
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[X] I've signed off with an email address that matches the commit author.
The generated types for
metadata
andresource.*.metadata
were broken because the code generator ignored theadditionalProperties
and instead generated concrete types without any support for additional metadata entries.Unfortunately we need the best of both worlds: an arbitrary map, while still checking for required properties during validation.
To fix this we generate the types from a 'modified' version of the spec in which we treat it like a generic map[string]interface{}. This 'modified' version is generated from a Makefile which also allows us to better codify the update-schema process.
The validation continues to use the raw spec file which can validate the required fields within the arbitrary object.
This library will then be imported into score-compose and any other score implementations that can consume it.
Types of changes
Checklist: