Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
42 lines (30 sloc)
1.22 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
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 | |
{ | |
"json.schemas": [ | |
... | |
{ | |
"fileMatch": [ | |
"/foo/test/*.json" | |
], | |
"url": "./foo/foo.schema.json" | |
} | |
] | |
} | |
``` | |
## Background | |
Validation tests use [ajv-cli](https://github.com/ajv-validator/ajv-cli) via Docker. Refer to `docker-compose.yml` and `.containers/ajv-cli/Dockerfile` for details. | |
See the [JSON Schema](https://json-schema.org) docuemtation for more information. |