-
-
Notifications
You must be signed in to change notification settings - Fork 215
Update unevaluatedProperties and unevaluatedItems tests #332
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
Amazing, thanks! Will have a look and leave any comments but this looks great! |
It looks like you're replacing the existing tests rather than adding new ones. Is that correct? |
Yeah, I hope that's ok. Let me know if there's something you think I should add back in. |
Those tests highlighted a failure in my lib, so I'd like the scenarios (or similar) to remain. |
08bdd5d
to
b091bf5
Compare
I think everything in the existing tests are covered and more. I'm reluctant to just restore the tests as they were because I think they will at least mostly duplicate the other tests. I'd rather add tests focused on what's missing. I'm just not sure what's missing. |
Yeah I think we basically need to go through each old test and ensure each is represented in the new ones. |
I may not have a chance to do so myself for a few more days -- if either of you (or anyone else) give it a shot it'd obviously be super appreciated otherwise yeah will try to follow up with some comments as soon as I can. |
I went over it a third time to make a matrix to help others do their own analysis. This time, I noticed something that was missing. It doesn't test that properties declared in a failed unevaluatedProperties.json
unevaluatedItems.json
|
b091bf5
to
6077b07
Compare
@jdesrosiers I notice these lines in your matrix:
These look like they may have typos since there's duplicates. |
@ssilverman It looks like it's just a duplicate. I edited the matrix. Thanks! |
I found something that was missing and added a couple more tests. |
I know there's a lot going on right now, but I wanted to bump this issue so it doesn't get lost. I've been over it in detail four times now and I'm very confident that there isn't anything in the old tests that isn't covered in the new tests. |
Yeah I had a quick look myself too and I think it looked good to me too. Merging, and thanks, appreciated! |
My library is failing due to one of these tests, and I'm struggling to find the reasoning behind it. This is the test case: {
"description": "unevaluatedProperties with not",
"schema": {
"type": "object",
"properties": {
"foo": { "type": "string" }
},
"not": {
"not": {
"properties": {
"bar": { "const": "bar" }
},
"required": ["bar"]
}
},
"unevaluatedProperties": false
},
"tests": [
{
"description": "with unevaluated properties",
"data": {
"foo": "foo",
"bar": "bar"
},
"valid": false
}
]
} As I understand it, double negation is the same as not using negation. I.e. {
"type": "object",
"properties": {
"foo": { "type": "string" }
},
"not": {
"not": {
"properties": {
"bar": { "const": "bar" }
},
"required": ["bar"]
}
},
"unevaluatedProperties": false
} Is semantically equivalent to the following schema: {
"type": "object",
"properties": {
"foo": { "type": "string" },
"bar": { "const": "bar" }
},
"required": ["bar"],
"unevaluatedProperties": false
} Which means that the result is Is the intention that schemas inside a |
No, not quite. I wonder how you are implementing the I hope this makes sense, and good luck to you in getting to the bottom of it in your implementation 👯♀️ |
@karenetheridge Thanks for the quick response!
I think that clarifies everything! |
These are the tests I used to implement
unevaluatedProperties
andunevaluatedItems
. They cover a lot more than the current tests, so now I'm sharing if you want them.