bug: prefixItems schema does not evaluate
jeremyfiel opened this issue · 2 comments
jeremyfiel commented
The following schema does not produce an error as expected where idddd
is an additional property. Is this a bug or is my schema wrong?
{
"$id": "https://www.freecodecamp.org/classroom/userDataRequest",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "UserDataRequest",
"description": "Queries a collection of users and certifications",
"users": {
"type": "array",
"uniqueItems": true,
"prefixItems": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
}
}
},
"items": {
"description": "name of the certification block",
"type": "string",
"pattern": "^[A-Za-z][\/A-Za-z0-9-]*[A-Za-z]$"
}
},
"required": ["users"]
}
{
"users": [
{
"idddd": "123456"
},
"2022/responsive-web-design",
"quality-assurance"
]
}
jeremyfiel commented
I tried a few different things and none of them are evaluated, not only additionalProperties
adding required": ["id"]
did not produce an error
passing a number to idddd
did not produce an error.
{
"users": [
{
"idddd": 123456
},
"2022/responsive-web-design",
"quality-assurance"
]
}
jeremyfiel commented
I missed the root level properties
definition
also the prefixItems is an array schema.