-
-
Notifications
You must be signed in to change notification settings - Fork 215
Tests for dependentSchema and propertyDependencies with unevaluatedPro… #732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these need to be split up differently.
The thing we're testing here is additionalProperties
and unevaluatedProperties
. The tests should go in those files.
Also, we also need a dependentSchemas
test for draft-next.
Feww..! GREEN :) |
The files look fine, but I think we need more test cases for each scenario. What does a passing instance look like? What if the nested subschemas themselves do declare properties? Etc. |
Please review this |
97ca40d
to
06892f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we need a few new test scenarios that define foo
as a property. Apply those changes to all drafts as well, please.
Got it! I misunderstood the |
This one {
"description": "dependent schema with additionalProperties",
"schema": {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"dependentSchemas": {
"foo": {}
},
"additionalProperties": false
},
"tests": [
{
"description": "dependentSchemas properties are counted as additional properties",
"data": {
"foo": ""
},
"valid": false
}
]
} |
No, you didn't misunderstand. What you have is good, except for the test cases I commented on. For those, we need schemas like the one I showed. You'll also need to rebase this branch since I merged another PR. |
…perties and additionalProperties Signed-off-by: MeastroZI <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test scenarios look good to me. All the tests pass against my implementation. 🎉
Just a few descriptions to update. Thanks for the work on this.
I just realize it after 5 commits that i can add the suggested changes in batch and then commit them in once 😅 , should i squash them into once ? |
adding tests for dependentSchema and propertyDependencie with unevaluatedProperties and additionalProperties
refer this issue #626