-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visualise JSON Schema using JSON Schema Viewer #9
Comments
Steps to creating your very first visualisation of a schemaRepo Setup
Schema SetupYou will notice that the documentation for getting a simple schema up and running is not so straight forward, so here is what I suggest: schema.json{
"id": "schema.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"version": "1.1.3",
"description": "schema for ADIwg mdJSON metadata",
"type": "object",
"required": ["version", "contact", "metadata"],
"properties": {
"user": {
"$ref": "sub-schema/user.json",
"example": "../schema-example/user.json"
}
}
} user.json{
"id": "user.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Contains user details",
"properties": {
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"address": {
"type":"object",
"properties": {
"billing_address": {
"$ref": "address.json",
"example": "../schema-example/address.json"
},
"delivery_address": {
"$ref": "address.json",
"example": "../schema-example/address.json"
}
}
},
"age": {
"type":"number",
"maxValue": 100
}
}
} address.json{
"id": "address.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Contains user address",
"properties": {
"street_name": {
"type": "string"
},
"city": {
"type": "string"
},
"postcode": {
"type": "string"
},
"country": {
"type": "string"
}
}
} JSON-Schema-Viewer Setup
Build & Run JSON Schema Viewer
We have our very first JSON Schema Viewer*And it should look something like this 🎉 * To add examples for each json file, simple add some examples in json file and link it to the schema Example
|
Having experimented with this a little more, I feel that JSON Schema Viewer is rough around the edges, It works great if your schema is not too complex. |
Why
You have a really great schema in place, which is understood by all the technical people in your team, but what about the non-technical people? Visualisation of a schema will lead to better understanding of the schema across the team.
How
We will use JSON Schema Viewer to visualise the schema
The text was updated successfully, but these errors were encountered: