Uh oh!
There was an error while loading. Please reload this page.
Additional properties: false to allow better type checking from JSON schemas - #3388
Additional properties: false to allow better type checking from JSON schemas#3388quentinus95 wants to merge 3 commits into
Conversation
alanpoulain
commented
Feb 15, 2020
You should fix the CS too 🙂 |
quentinus95
commented
Feb 15, 2020
Done! I was double checking the failing tests as well but it seems unrelated. |
teohhanhui
commented
Feb 20, 2020
Let's wait for #3402 first, as it'll make use of |
quentinus95
commented
Feb 26, 2020
@teohhanhui is there anything I can do to speed up the merging process? Having this change merged and released would highly reduce the bug risks in my production-deployed TypeScript consumers. |
soyuka
commented
Feb 26, 2020
@quentinus95 we need to progress at our own pace :|. You should be able to use your fork (and this patch) by tweaking the |
quentinus95
commented
Feb 26, 2020
@soyuka sure! It was just to be 100% sure nothing more was required on my side. |
quentinus95
commented
Apr 8, 2020
@teohhanhui any feedback now that #3402 has been merged? |
soyuka
commented
Apr 15, 2020
could you rebase? thanks! |
dunglas
left a comment
There was a problem hiding this comment.
Sorry for the late review...
Can you also rebase please?
| } | ||
| $definition = new \ArrayObject(['type' => 'object']); | ||
| $definition['additionalProperties'] = false; |
There was a problem hiding this comment.
We should set this flag only if the allow_extra_attributes normalization context option is set to false: #1217
soyuka
commented
Nov 13, 2020
Thanks @quentinus95 ! Superseeded by #3804 |
This change sets additional properties to false on all definitions so developers using code generators (e.g. TypeScript code generators from JSON schema) can have safer type checks.