php-json-schema icon indicating copy to clipboard operation
php-json-schema copied to clipboard

Issue with additionalProperties

Open bellostom opened this issue 10 years ago • 0 comments

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

bellostom avatar Oct 10 '14 11:10 bellostom