Skip to content

Issue with additionalProperties #10

@bellostom

Description

@bellostom

Hi

First of all nice job on the validator
However, I have stumbled upon an issue with the additioalProperties
Consider the below schema and data, which I tried to validate online at
https://json-schema-validator.herokuapp.com/
and it does not pass validation (as it should not)

Schema
{
"type": "object",
"properties": {
"class": {
"type": "string"
},
"meta_keywords": {
"type": "string"
},
"meta_description": {
"type": "string"
},
"header": {
"type": "string"
},
"footer": {
"type": "string"
},
"page_title": {
"type": "string"
},
"containers": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"template": {
"type": "string"
},
"columns": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "integer"
},
"uniqueItems": true
}
}
}
}
}
},
"required": [
"header",
"footer",
"page_title",
"containers"
]
}

data
{"page_title":"wefewfw","meta_keywords":"","meta_description":"","containers":[{"id":1412867034986,"template":"6-6","columns":{"column1":["13"],"column2":["14"]}}],"header":"10","footer":"9"}

However, when I use your class it passes.

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions