| 1 | # JSON schema |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | This directory contains the [JSON Schema](https://json-schema.org) for validating JSON covered by this specification. |
| 6 | |
| 7 | The layout of the files is as follows: |
| 8 | |
| 9 | * [config-schema.json](config-schema.json) - the primary entrypoint for the [configuration](../config.md) schema |
| 10 | * [config-linux.json](config-linux.json) - the [Linux-specific configuration sub-structure](../config-linux.md) |
| 11 | * [config-solaris.json](config-solaris.json) - the [Solaris-specific configuration sub-structure](../config-solaris.md) |
| 12 | * [config-windows.json](config-windows.json) - the [Windows-specific configuration sub-structure](../config-windows.md) |
| 13 | * [state-schema.json](state-schema.json) - the primary entrypoint for the [state JSON](../runtime.md#state) schema |
| 14 | * [defs.json](defs.json) - definitions for general types |
| 15 | * [defs-linux.json](defs-linux.json) - definitions for Linux-specific types |
| 16 | * [defs-windows.json](defs-windows.json) - definitions for Windows-specific types |
| 17 | * [validate.go](validate.go) - validation utility source code |
| 18 | |
| 19 | |
| 20 | ## Utility |
| 21 | |
| 22 | There is also included a simple utility for facilitating validation. |
| 23 | To build it: |
| 24 | |
| 25 | ```bash |
| 26 | go get github.com/xeipuuv/gojsonschema |
| 27 | go build ./validate.go |
| 28 | ``` |
| 29 | |
| 30 | Or you can just use make command to create the utility: |
| 31 | |
| 32 | ```bash |
| 33 | make validate |
| 34 | ``` |
| 35 | |
| 36 | Then use it like: |
| 37 | |
| 38 | ```bash |
| 39 | ./validate config-schema.json <yourpath>/config.json |
| 40 | ``` |
| 41 | |
| 42 | Or like: |
| 43 | |
| 44 | ```bash |
| 45 | ./validate https://raw.githubusercontent.com/opencontainers/runtime-spec/<runtime-spec-version>/schema/config-schema.json <yourpath>/config.json |
| 46 | ``` |