one-data-model / language

(Old repo:) Simple Definition Format (SDF) for One Data Model definitions
7 stars 4 forks source link

["$id"] declaring a unique identifier to the schema #99

Open jpradocueva opened 4 years ago

jpradocueva commented 4 years ago

Add to the schema document "sdf-schema.json" a unique identifier ($id) property:

"$id": "http://yourdomain.org/schemas/v1_0/sdf-schema.json"

It is part of the base practice to include this property on each schema.

Points for discussion:

The addition of this "$id": will allow to insert the "$schema": property:

"$schema": "http://yourdomain.org/schemas/v1_0/sdf-schema.json"

inside of each model. This will allow to validate the model against the defined schema "sdf-schema.json".

cabo commented 4 years ago

Note that a language is defined by syntax and semantics; the language schema is just an expression of the syntax.

We may want to evolve the language schema along with other parts of the language in an upwards compatible way; hardwiring a reference to a file containing an older schema into the models makes it harder to just check them with a newer schema.

In summary, a schema file reference is neither solving the language versioning issue nor would it be a good way to do this if it were.

jpradocueva commented 4 years ago

@cabo Let's review the original requirement.

I believe that it is important to be able to validate every single model submitted to the registry. This validation should be done against the sdf-schema.json schema. The validation should check for well formed and valid.

Do you agree with this requirement? How do you suggest that we can meet this requirement?