Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions schema/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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`
go get ./...
go build .
rm -rf $GOPATH
```

Then use it like:

```bash
./schema schema.json <yourpath>/config.json
```
2 changes: 1 addition & 1 deletion schema/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

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

Expand Down