OpenAPI could work if you have one content-type for each payload schema for the same endpoint, for instance if we can identify canonical json, canonical xml, flat json, flat xml, etc. etc. canonical yaml??? with one content-type for each and one schema for each, that could work. But! this could generate a maintenance hell very quickly if not done correctly, we need to figure out how to work with multiple content types and schemas and whatâs the best structure for the OpenAPI spec in this scenario, that is why I think we need to focus just on canonical JSON then add other formats, so we have one working spec and in the process we can learn how to deal with multiple formats and the maintenance issue.
Sorry I didnât got that in the meeting.
I think an official flat format should have itâs own specific schema, though Iâm not sure what a âgenericâ schema is, is that an schema with some elements defined and other elements open?
Canonical JSON is kind of the de facto format for the REST API spec. I donât think itâs about code generation or anything, it just about supporting the default format in the OpenAPI spec then add other formats. Right now only canonical JSON and canonical XML have formal schemas in openEHR (part of the spec). Other formats are not yet part of the spec, so IMO we should put effort on have a complete OpenAPI spec with what are current official formats for openEHR, not community/vendor ad-hoc formats. Though, when those are formalized and part of the spec, they should have their own OpenAPI spec schema too.
I donât think that is the focus of this task. Having an OpenAPI spec allows to generate/update documentation on the fly and that doc to be executable on top of an implementation to facilitate testing APIs. There are no templates involved in that, it just makes the maintenance of the REST API spec easier/faster. Thatâs kind of a first goal. Then, from that spec, it is possible to generate code as a byproduct, some might see value on that, though it is neither the main goal IMO. Another byproduct would be to generate test cases from existing metadata/data, like templates, and use that for conformance testing, and that might be related with what you mentioned, and would be of my special interest, but itâs not the main goal either, just something we might be able to do if we can release an official OpenAPI spec.
@sebastian.iancu when I mention canonical JSON, though Iâm referring to the current RM schemas, in the context of the REST API those canonical JSON schemas should be the relaxed ones not the RM schemas. The relaxed ones should be derived from classes denoted in the Service Model specification, as the serialized form of instances of those classes.
Exactly, JSON is kind of the current de facto format for the REST spec, not an optional thing.