aas-specs
aas-specs copied to clipboard
Validate submodel reference in JSON Schema
Check submodel references to be only ModelReference<SubmodelReference>
@mhrimaz Thanks for the PR!
@sebbader-sap @s-heppner maybe we should collect all these patches and re-write them as Python code so that they can be re-applied to new versions as well?
It definitely makes sense to locate them in the python file. The ModelReference
constraint is not JSON-specific AND will be valid also for future versions. My main question is, can you actually model this constraint in core-works?
Probably, I just wouldn't know how.
@sebbader-sap the constraint has been in aas-core-meta since forever, but we can not transpile it to JSON schema. At least, I don't know how.
We truly thank you for your input, @mhrimaz!
However, we sadly cannot allow changing the schema files by hand, since they are generated using aas-core-works. That particular constraint is implemented in aas-core-meta (meaning it appears for example in the generated SDKs), however cannot be transpiled into the JSON schema with reasonable effort, so that we decided not to implement that particular generation function. If you're willing to, you're more than welcome to contribute to the schema generation functionality at aas-core-codegen.
@mristin We decided against the semantic patching approach you mentioned due to not wanting to introduce another layer of code that needs to be maintained.
I'll close the pull request for now, but feel free to re-open it in the future.