json-schemas
JSON schemas used by Internet2 Trust & Identity
Getting Started
To test all schemas, run make
.
Contributing
To add a new schema, create a directory structure like the following (where "foo" is the name of the model represented by the schema):
- foo/ - The schema's top-level directory
- test/ - Test examples
- invalid-*.json - Test examples which should be invalid
- valid-*.json - Test examples which should be valid
- foo.schema.json - The schema definition
- README.md - Documentation for the schema
- test/ - Test examples
To run validation tests against the schema, run make foo
.
If you're using Visual Studio Code, you may also want to edit .vscode/settings.json
, adding an object to the json.schemas
array that will validate test files using the new schema:
{
"json.schemas": [
...
{
"fileMatch": [
"/foo/test/*.json"
],
"url": "./foo/foo.schema.json"
}
]
}
Background
Validation tests use ajv-cli via Docker. Refer to docker-compose.yml
and .containers/ajv-cli/Dockerfile
for details.
See the JSON Schema docuemtation for more information.