carp.core-kotlin
carp.core-kotlin copied to clipboard
Replace JSON pointer URI fragment with anchor references in JSON schemas
The json-schema-validator library we want to use for JSON schema validation does not yet support named anchor lookup for the metaschema we are using (draft 2019/09).
As a workaround, we currently use JSON pointer URIs within our schemas to point to these anchors.
The current locations are:
TriggeredTask.jsonto point toTaskControl#Control- In application service request objects (e.g.,
DataStreamServiceRequest.json) to point to definitions within the same file JsonSchemaTest.ktto load the reponse schemas of requests
Once json-schema-validator provides support for this, we can upgrade and replace these references with named anchor references.
This works partially with a bugfix for json-schema-validator introduced in 1.0.67. All external references to anchors now use the anchor notation. However, internal anchor references still fail and currently thus still use the full path notation.
However, internal anchor references still fail and currently thus still use the full path notation.
With the latest version of JSON schema validator this now also works for internal references. However, it begs the question whether we want to replace all internal references with anchors (and thus add anchors where there currently aren't any).
Are there conventions for when to use an anchor and when not?