Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
epoberezkin committed Mar 12, 2016
1 parent f0fcaf9 commit 98af2e6
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions README.mdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Command line interface for [ajv](https://github.com/epoberezkin/ajv), one of the
[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/ajv-cli/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/ajv-cli?branch=master)


# Installation
## Installation

```sh
npm install ajv-cli
```

# Help
## Help

```sh
ajv help
Expand All @@ -23,7 +23,7 @@ ajv help compile
```


# Validate data
## Validate data

This command validates data files against JSON-schema

Expand All @@ -35,14 +35,14 @@ ajv -s test/schema.json -d test/valid_data.json
You can omit `validate` command name and `.json` from the [input file names](https://nodejs.org/api/modules.html#modules_file_modules).


## Parameters
#### Parameters

#### `-s` - file name of JSON-schema
##### `-s` - file name of JSON-schema

Only one schema can be passed in this parameter


#### `-d` - JSON data
##### `-d` - JSON data

Multiple data files can be passed, as in `-r` parameter:

Expand All @@ -53,21 +53,21 @@ ajv -s test/schema.json -d "test/valid*.json"
If some file is invalid exit code will be 1.


#### `-r` - referenced schemas
##### `-r` - referenced schemas

The schema in `-s` parameter can reference any of these schemas with `$ref` keyword.

Multiple schemas can be passed both by using this parameter mupltiple times and with [glob patterns](https://github.com/isaacs/node-glob#glob-primer). Glob pattern should be quoted and extensions cannot be omitted.


#### `-m` - meta-schemas
##### `-m` - meta-schemas

Schemas can use any of these schemas as a meta-schema (that is the schema used in `$schema` keyword - it is used to validate the schema itself).

Multiple meta-schemas can be passed, as in `-r` parameter.


## Options
#### Options

`--errors=`: error reporting format. Possible values:

Expand All @@ -77,7 +77,7 @@ Multiple meta-schemas can be passed, as in `-r` parameter.
- `text`: human readable error messages with data paths


# Compile schemas
## Compile schemas

This command validates and compiles schema without validating any data.

Expand All @@ -87,31 +87,31 @@ It can be used to check that the schema is valid.
ajv compile -s schema
```

## Parameters
#### Parameters

#### `-s` - file name(s) of JSON-schema(s)
##### `-s` - file name(s) of JSON-schema(s)

Multiple schemas can be passed both by using this parameter mupltiple times and with [glob patterns](https://github.com/isaacs/node-glob#glob-primer).

```sh
ajv compile -s "test/schema*.json"
```

#### `-r` - referenced schemas
##### `-r` - referenced schemas

The schema in `-s` parameter can reference any of these schemas with `$ref` keyword.

Multiple schemas can be passed, as in `-s` parameter.


#### `-m` - meta-schemas
##### `-m` - meta-schemas

Schemas can use any of these schemas as a meta-schema (that is the schema used in `$schema` keyword - it is used to validate the schema itself).

Multiple meta-schemas can be passed, as in `-s` parameter.


# Ajv options
## Ajv options

You can pass the following Ajv options:

Expand All @@ -137,11 +137,11 @@ Options can be passed in either dash-case and camelCase.
See [Ajv Options](https://github.com/epoberezkin/ajv#options) for more information.


# Version History
## Version History

See https://github.com/jessedc/ajv-cli/releases


# Licence
## Licence

MIT

0 comments on commit 98af2e6

Please sign in to comment.