Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a standard for specifying a version for json schema

One of our development partners have asked if there is a way we could specify an interface version within our JSON Schema definition. There isn't a "$version" key so is there a recognised "standard" that we ought to follow (I can't use $id as we are using $ref's elsewhere so the document won't validate any more). We are on Draft-6 so $comment isn't available per-se.

Validation-wise XML Spy is quite happy for me to add a "version" key to the top level, so I could just do that but if there is there a more usual approach I'd rather do that.

like image 816
Andy Macnaughton-Jones Avatar asked Apr 07 '20 09:04

Andy Macnaughton-Jones


People also ask

Is JSON Schema a standard?

JSON Schema is an IETF standard providing a format for what JSON data is required for a given application and how to interact with it. Applying such standards for a JSON document lets you enforce consistency and data validity across similar JSON data.

How do I specify a schema in a JSON file?

If you want to use a custom schema of your own that's part of your project, just click on your schema in Solution Explorer and then drag it to that dropdown list. Alternatively, you can use the $schema keyword in a JSON file to associate it with a schema.

Does JSON support versioning?

JSON-B does not have a versioning API but it has actually some versioning capabilities.

What is required in JSON Schema?

In JSON, the “keys” must always be strings. Each of these pairs is conventionally referred to as a “property”. In Python, "objects" are analogous to the dict type. An important difference, however, is that while Python dictionaries may use anything hashable as a key, in JSON all the keys must be strings.


1 Answers

Snowplow's SchemaVer semantic versioning for schemas is an option.

like image 95
Fernando Raposo Avatar answered Oct 14 '22 20:10

Fernando Raposo