Metainfo endpoint for exporting JSONSchema
Our metainfo API endpoint needs to be extended to support fetching metainfo definitions. The initial use case will be for exporting these definitions in JSONSchema.
The API endpoint should take into consideration that JSONSchema instances are identified with a URL (see here), which means that ideally we have a simple GET endpoint for retrieving these definitions.
The GET endpoint could look something like this:
/metainfo/<identifier>?type=<identifier-type>&format=jsonschema
There are at least three identifier types for metainfo definitions:
-
Qualified names (=m_def):
Example:
package_name.schema_packages.calculations.MySchemaThis is the most used format. Limitation: can only fetch the most recently deployed definition. -
Hashes:
Example:
AcKc1psJIzC75pBdAlUgmyrA18aCThis is the most unique way, but currently not really used. Can also target different versions of the same schema. -
Indices
Example:
metainfo/nomad.datamodel.datamodel/section_definitions/5This format is used by the Graph API. Not really useful for many things.
For the JSONSchema export, we can start out with the qualified names an identifier type, but I think eventually we will need to move to the hash-based identification. There are some design choices for the URL query parameters etc. that we can iterate with potentials users of this endpoint.