Skip to content

Commit

Permalink
Merge pull request #45 from jessedc/v3
Browse files Browse the repository at this point in the history
update for draft-07 / ajv v6
  • Loading branch information
epoberezkin authored Jan 9, 2018
2 parents 92dde81 + 2ba8f32 commit 356a431
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Command line interface for [ajv](https://github.com/epoberezkin/ajv), one of the [fastest json schema validators](https://github.com/ebdrup/json-schema-benchmark).

[![Build Status](https://travis-ci.org/jessedc/ajv-cli.svg?branch=master)](https://travis-ci.org/jessedc/ajv-cli)
[![npm version](https://badge.fury.io/js/ajv-cli.svg)](https://www.npmjs.com/package/ajv-cli)
[![Code Climate](https://codeclimate.com/github/epoberezkin/ajv-cli/badges/gpa.svg)](https://codeclimate.com/github/epoberezkin/ajv-cli)
[![npm](https://img.shields.io/npm/v/ajv-cli.svg)](https://www.npmjs.com/package/ajv-cli)
[![Coverage Status](https://coveralls.io/repos/github/jessedc/ajv-cli/badge.svg?branch=master)](https://coveralls.io/github/jessedc/ajv-cli?branch=master)
[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv)


## Contents
Expand Down
2 changes: 2 additions & 0 deletions commands/ajv.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ var path = require('path');

module.exports = function (argv) {
var opts = options.get(argv);
opts.schemaId = 'auto';
if (argv.o) opts.sourceCode = true;
var ajv = new Ajv(opts);
var invalid;
ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json'));
ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json'));
addSchemas(argv.m, 'addMetaSchema', 'meta-schema');
addSchemas(argv.r, 'addSchema', 'schema');
customFormatsKeywords(argv.c);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
"url": "https://github.com/jessedc/ajv-cli"
},
"dependencies": {
"ajv": "^5.0.0",
"ajv": "^6.0.0",
"ajv-pack": "^0.3.0",
"fast-json-patch": "^0.5.6",
"glob": "^7.0.3",
"json-schema-migrate": "^0.2.0",
"minimist": "^1.2.0"
},
"devDependencies": {
"ajv-keywords": "^2.0.0",
"ajv-keywords": "^3.0.0",
"coveralls": "^2.11.8",
"eslint": "^2.4.0",
"mocha": "^2.4.5",
Expand Down
4 changes: 2 additions & 2 deletions test/custom/schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-06/schema#",
"id": "schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "schema.json",
"typeof": "number"
}
2 changes: 1 addition & 1 deletion test/meta/meta_schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-06/schema#",
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://example.com/my_meta_schema#",
"title": "Core schema meta-schema",
"definitions": {
Expand Down
2 changes: 1 addition & 1 deletion test/schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-06/schema#",
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "schema.json",
"description": "basic schema from z-schema benchmark (https://github.com/zaggino/z-schema)",
"title": "Product set",
Expand Down

0 comments on commit 356a431

Please sign in to comment.