Ongoing discussions within the SWIM communities of interest

Page tree

Ongoing discussions within the SWIM communities of interest

Skip to end of metadata
Go to start of metadata

Resources related to the JSON schemas, such as tooling, terminology, examples

Resources

About JSON Schema 

Online Validation

Editors (creating content based on the Schema)

Terminology

JSON Schema

  • JSON Schema asserts what a JSON document must look like, ways to extract information from it, and how to interact with it

JSON instance

  • A JSON document to which a schema is applied is known as an "instance".

JSON Schema validation

  • asserts constraints on the structure of instance data


Examples 

The Donlon TOBT service is provided as an example using schema v0.0.3

Validation rules 

constructcapabilityuse

"enum": ["Street", "Avenue", "Boulevard"]

for a property, indicates the list of allowed valuesused for all code lists

"additionalProperties": false

for an object indicates that no other properties are allowed than the ones mentioned in the schemaused for every object (since 3c)

"required": ["prop1", "prop2l"]

for an object indicates the list of properties that are mandatoryused according to rules (since 3d)
"minItems": 1for a property of type array, indicates the minimum number of elements in the arrayused for many arrays

"minLength": 1

for a property of type string, indicates the minimum length of the stringused for every mandatory string to avoid empty string (since 3e)

"pattern": "^\d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])$"

for a property of type string, indicates the pattern of its content

used for dates in 3f (could be used for date, url or email addresses eg)


  • No labels