You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
947 B
36 lines
947 B
'use strict'; |
|
|
|
var META_SCHEMA_ID = 'http://json-schema.org/draft-06/schema'; |
|
|
|
module.exports = function (ajv) { |
|
var defaultMeta = ajv._opts.defaultMeta; |
|
var metaSchemaRef = typeof defaultMeta == 'string' |
|
? { $ref: defaultMeta } |
|
: ajv.getSchema(META_SCHEMA_ID) |
|
? { $ref: META_SCHEMA_ID } |
|
: {}; |
|
|
|
ajv.addKeyword('patternGroups', { |
|
// implemented in properties.jst |
|
metaSchema: { |
|
type: 'object', |
|
additionalProperties: { |
|
type: 'object', |
|
required: [ 'schema' ], |
|
properties: { |
|
maximum: { |
|
type: 'integer', |
|
minimum: 0 |
|
}, |
|
minimum: { |
|
type: 'integer', |
|
minimum: 0 |
|
}, |
|
schema: metaSchemaRef |
|
}, |
|
additionalProperties: false |
|
} |
|
} |
|
}); |
|
ajv.RULES.all.properties.implements.push('patternGroups'); |
|
};
|
|
|