Skip to content
Permalink
68ca19562d
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
42 lines (30 sloc) 1.22 KB

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.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.