Merge pull request #718 from marshall007/marshall_713
feat: allowedValue param in const keyword errormaster
commit
1c702d639c
|
@ -899,7 +899,7 @@ This allows you to do nice things like the following.
|
|||
|
||||
```javascript
|
||||
var validate = new Ajv().addSchema(schema).addFormat(name, regex).getSchema(uri);
|
||||
```
|
||||
```
|
||||
|
||||
##### .addMetaSchema(Array<Object>|Object schema [, String key]) -> Ajv
|
||||
|
||||
|
@ -1199,6 +1199,7 @@ Properties of `params` object in errors depend on the keyword that failed valida
|
|||
- `patternRequired` (in ajv-keywords) - property `missingPattern` (required pattern that did not match any property).
|
||||
- `type` - property `type` (required type(s), a string, can be a comma-separated list)
|
||||
- `uniqueItems` - properties `i` and `j` (indices of duplicate items).
|
||||
- `const` - property `allowedValue` pointing to the value (the schema of the keyword).
|
||||
- `enum` - property `allowedValues` pointing to the array of values (the schema of the keyword).
|
||||
- `$ref` - property `ref` with the referenced schema URI.
|
||||
- `oneOf` - property `passingSchemas` (array of indices of passing schemas, null if no schema passes).
|
||||
|
|
|
@ -167,7 +167,7 @@
|
|||
additionalItems: "{ limit: {{=$schema.length}} }",
|
||||
additionalProperties: "{ additionalProperty: '{{=$additionalProperty}}' }",
|
||||
anyOf: "{}",
|
||||
const: "{}",
|
||||
const: "{ allowedValue: schema{{=$lvl}} }",
|
||||
contains: "{}",
|
||||
dependencies: "{ property: '{{= it.util.escapeQuotes($property) }}', missingProperty: '{{=$missingProperty}}', depsCount: {{=$deps.length}}, deps: '{{= it.util.escapeQuotes($deps.length==1 ? $deps[0] : $deps.join(\", \")) }}' }",
|
||||
'enum': "{ allowedValues: schema{{=$lvl}} }",
|
||||
|
|
Loading…
Reference in New Issue