JSON Schema and OpenAPI: current state, and how to progress

@sebastian.iancu worked on two flavors (and tried many alternatives) of the JSON schemas for the REST APIs, I think one was focused on data validation (syntax) and the other one on code generation (correct types and hierarchies, etc).

For the work I do in our CDR, I only use the data validation one for checking the commits in JSON. I think the schemas I use were generated from the BMMs at some point, though I think I fixed some errors then merged all together in a single file JSON Schema for convenience (it’s easier to validate against a single schema than many schemas that have references between them).

I’m sorry I can’t add much value to this discussion right now, I personally don’t see a use case for code generation based on schemas yet. For instance, what I did in the openEHR Toolkit to generate JSON examples is all based on the OPT 1.4 model, the RM and the JSON schema, but not using the schema directly, basically I’ve built a JSON serializer for the RM that complies with the JSON schema.

1 Like