Skip to content

AdditionalProperties not being applied when value could be array#438

Open
dharanikumar-19 wants to merge 1 commit into
voxpupuli:masterfrom
dharanikumar-19:AdditionalProperties_for_array
Open

AdditionalProperties not being applied when value could be array#438
dharanikumar-19 wants to merge 1 commit into
voxpupuli:masterfrom
dharanikumar-19:AdditionalProperties_for_array

Conversation

@dharanikumar-19

@dharanikumar-19 dharanikumar-19 commented Aug 17, 2019

Copy link
Copy Markdown

This fix should will resolve this issue #404

Given the following schema:

{ "type": [ "object", "null" ], "properties": { "a_string": { "type": "string" } }, "additionalProperties": false }
The sample data
object = { "a_string": "this property is allowed by the schema", "an_extra_string": "the schema does not allow this property" }

Previously it does not raise any error

After the fix
Following error will throw
JSON::Schema::ValidationError: The property '#/' contains additional properties ["an_array"] outside of the schema when none are allowed

@pboling

pboling commented Feb 14, 2021

Copy link
Copy Markdown

#423 (comment)

@bastelfreak

Copy link
Copy Markdown
Member

Hi @dharanikumar-19, thanks for this PR. Are you able to rebase and add tests for the change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants