refactor: rename $data.js and $data.json without $, closes #526

master
Evgeny Poberezkin 2017-11-05 22:08:36 +00:00
parent b6d927980b
commit 9abe4e78a9
4 changed files with 5 additions and 5 deletions

View File

@ -7,7 +7,7 @@ var compileSchema = require('./compile')
, stableStringify = require('fast-json-stable-stringify')
, formats = require('./compile/formats')
, rules = require('./compile/rules')
, $dataMetaSchema = require('./$data')
, $dataMetaSchema = require('./data')
, patternGroups = require('./patternGroups')
, util = require('./compile/util');
@ -433,7 +433,7 @@ function addFormat(name, format) {
function addDraft6MetaSchema(self) {
var $dataSchema;
if (self._opts.$data) {
$dataSchema = require('./refs/$data.json');
$dataSchema = require('./refs/data.json');
self.addMetaSchema($dataSchema, $dataSchema.$id, true);
}
if (self._opts.meta === false) return;

View File

@ -38,7 +38,7 @@ module.exports = function (metaSchema, keywordsJsonPointers) {
keywords[key] = {
anyOf: [
schema,
{ $ref: 'https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/$data.json#' }
{ $ref: 'https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#' }
]
};
}

View File

@ -50,7 +50,7 @@ function addKeyword(keyword, definition) {
metaSchema = {
anyOf: [
metaSchema,
{ '$ref': 'https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/$data.json#' }
{ '$ref': 'https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#' }
]
};
}

View File

@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/$data.json#",
"$id": "https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#",
"description": "Meta-schema for $data reference (JSON-schema extension proposal)",
"type": "object",
"required": [ "$data" ],