2016-03-31 02:49:29 +08:00
|
|
|
# JSON schema
|
|
|
|
|
|
|
|
## Overview
|
|
|
|
|
|
|
|
This directory contains the [JSON Schema](http://json-schema.org/) for
|
|
|
|
validating the `config.json` of this container runtime specification.
|
|
|
|
|
|
|
|
The layout of the files is as follows:
|
|
|
|
* [schema.json](schema.json) - the primary entrypoint for the whole schema document
|
|
|
|
* [schema-linux.json](schema-linux.json) - this schema is for the Linux-specific sub-structure
|
|
|
|
* [defs.json](defs.json) - definitions for general types
|
|
|
|
* [defs-linux.json](defs-linux.json) - definitions for Linux-specific types
|
|
|
|
* [validate.go](validate.go) - validation utility source code
|
|
|
|
|
|
|
|
|
|
|
|
## Utility
|
|
|
|
|
|
|
|
There is also included a simple utility for facilitating validation of a
|
|
|
|
`config.json`. To build it:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
export GOPATH=`mktemp -d`
|
2016-04-14 10:39:12 +08:00
|
|
|
go get -d ./...
|
2016-03-31 02:49:29 +08:00
|
|
|
go build .
|
|
|
|
rm -rf $GOPATH
|
|
|
|
```
|
|
|
|
|
|
|
|
Then use it like:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
./schema schema.json <yourpath>/config.json
|
|
|
|
```
|