Closed miguelzapaton closed 3 years ago
IMHO, since all changes in schema v1 (with semver) must be backwards compatible, the id should not matter. if/when we move to schema v2 we need a new id.
I agree. For the moment it's all backwards compatible as the "tt" change in 1.0.1 only affects the valuesets and not the structure.
The good news is that's not too late to put a "schemaver" in the $id once v2 is necessary, e.g.:
"$id": "https://id.uvci.eu/DGC.schema-2-0-0.json",
Closed as no further comments
Hello again,
I just started validating with the new DGC Schema version 1.0.1 in parallel with the older version 1.0.0
Some of my test JSON data files now have "ver": "1.0.0", others "ver": "1.0.1".
I use the Ajv validator but I'm sure other tools will show a similar behaviour:
As the schema $id of version 1.0.0 and version 1.0.1 are identical, Ajv complains when I'm trying to load the second schema in the same instance with ajv.addSchema(schema2-N, 'semver') or ajv.compile(schema2-N).
This makes it impossible to use the same Ajv instance for all DGC Schema versions. From an implementer's perspective this is quite impractical and resource inefficient (even when instance caching is used).
Ajv has wonderful mechanisms for managing multiple schemas and versions:
https://ajv.js.org/guide/managing-schemas.html
However, they seem to rely on different schema $id values.
As I understood it's generally a good idea with JSON Schema to include the semver (-> schemaver) in the $id.
Some further external links for interested people:
http://docs.mediachain.io/publishing/schema-recommendations
http://docs.snowplowanalytics.com/docs/pipeline-components-and-applications/iglu/common-architecture/schemaver/
Miguel