Closed dashameter closed 3 years ago
Change "items": [ { "type": "string" } ],
to "items": { "type": "string" } ,
. It will help.
on v.21-devnet this issue is solved, this registers successfully:
{
tweet: {
type: 'object',
indices: [
{ properties: [{ mentions: 'asc' }] },
],
properties: {
mentions: {
type: 'array',
items: { type: 'string' },
minItems: 0,
maxItems: 5,
},
},
additionalProperties: false,
},
}
Note: now using additionalItems
now throws:
{
keyword: 'unevaluatedProperties',
instancePath: '/documents/note/properties/message',
schemaPath: '#/patternProperties/%5E%5Ba-zA-Z%5D%5Ba-zA-Z0-9-_%5D%7B1%2C62%7D%5Ba-zA-Z0-9%5D%24/unevaluatedProperties',
params: { unevaluatedProperty: 'additionalItems' },
propertyName: undefined,
[Symbol(constructorArguments)]: [
'must NOT have unevaluated properties',
'unevaluatedProperties',
'/documents/note/properties/message',
'#/patternProperties/%5E%5Ba-zA-Z%5D%5Ba-zA-Z0-9-_%5D%7B1%2C62%7D%5Ba-zA-Z0-9%5D%24/unevaluatedProperties',
{ unevaluatedProperty: 'additionalItems' },
undefined
]
}
Expected Behavior
Support building an index over a
"type": "array"
field in data contracts so it can be queried by$in
,$elementMatch
,$all
.Current Behavior
Throws error:
type array cannot be used as index