Skip to content

Commit 9da1728

Browse files
committed
schema: add a README
Signed-off-by: Vincent Batts <[email protected]>
1 parent 6734c7a commit 9da1728

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

schema/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# JSON schema
2+
3+
## Overview
4+
5+
This directory contains the [JSON Schema](http://json-schema.org/) for
6+
validating the `config.json` of this container runtime specification.
7+
8+
The layout of the files is as follows:
9+
* [schema.json](schema.json) - the primary entrypoint for the whole schema document
10+
* [schema-linux.json](schema-linux.json) - this schema is for the Linux-specific sub-structure
11+
* [defs.json](defs.json) - definitions for general types
12+
* [defs-linux.json](defs-linux.json) - definitions for Linux-specific types
13+
* [validate.go](validate.go) - validation utility source code
14+
15+
16+
## Utility
17+
18+
There is also included a simple utility for facilitating validation of a
19+
`config.json`. To build it:
20+
21+
```bash
22+
export GOPATH=`mktemp -d`
23+
go get ./...
24+
go build .
25+
rm -rf $GOPATH
26+
```
27+
28+
Then use it like:
29+
30+
```bash
31+
./schema schema.json <yourpath>/config.json
32+
```

schema/validate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
func main() {
1212
if len(os.Args[1:]) != 2 {
13-
fmt.Printf("ERROR: usage is: %s <schema.json> <config.json>", os.Args[0])
13+
fmt.Printf("ERROR: usage is: %s <schema.json> <config.json>\n", os.Args[0])
1414
os.Exit(1)
1515
}
1616

0 commit comments

Comments
 (0)