-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
comprehensive test of keyword independence #385
base: main
Are you sure you want to change the base?
Conversation
dfd24bb
to
e6d47ef
Compare
I know at least one impl which thinks that Could you include this test too, please? |
e6d47ef
to
74ce43b
Compare
Oh, I missed how large this test is. Upd: apparently this test does not cover it, but that impl also fails other combinations. |
I forgot that boolean schemas weren't allowed in draft4, which the CI tests helpfully spotted. fix squashed! |
74ce43b
to
8fbb603
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
a54ca4e
to
c6a2e5e
Compare
uniqueItems + required is one of the combinations tested. it starts on line 2450. |
This comment has been minimized.
This comment has been minimized.
@karenetheridge Ah. I noticed that it was labeled as ready for review 🙂 |
c6a2e5e
to
096cd7e
Compare
No, sorry, that was a mistake. I was still running tests and diffs on my end and fixing the last remaining errors from removing boolean schemas for draft4. |
Keywords that are only in effect with instance data of one type should never interfere with keywords that require a different instance type. In particular, implementations should not attempt to infer the type of the instance data based on the keywords used by the schema.
096cd7e
to
a95d78c
Compare
ok, I think this is good to go now. I have run all the files locally and they all check out (as they should, because they are dead-simple.. except for the errors I made swapping out the boolean schemas for draft4) 👯♂️ |
Seems to work for me (draft2019-09 untested). Also, this is beneficial, I am aware of implementations which are triggered by these checks. |
@ChALkeR thanks for the review! With large changes like this, especially across multiple drafts, it's quite tricky to ensure there are no mistakes and that the files are reasonably consistent. Even programmatically generating the data like I did this time, I still made several errors when translating between drafts, as you saw :) With the number of test cases now, and the speed in which new ones are coming in, we are rapidly getting closer to needing an extra verification step where the tests are run across multiple implementations... e.g. #314 . |
For reference: mafintosh/is-my-json-valid#179 |
I cant' review a 20000 line PR, but thanks for including the script, that I can review, so if that seems correct this should be fine, will see if I can Perl hard enough to see what it does. |
yeah, the patch is a bit big :D |
Could this perhaps include the code to rebuild those files, in some form? |
I'll find the code that generated this and add it (we probably need a new directory to store these sorts of things, since we're doing it in other PRs too now). |
Yeah @ChALkeR had that good idea -- we should (whatever language is fine probably as long as it's reasonably easy to run. Perl I'm sure counts which is what I think you said you wrote this in originally?) But as in #414 (comment) can you pick some reasonably small subset of these (5 say) that we'll merge to the regular suite and cover a majority of what these'd cover, and then the rest we document by saying if you want the full comprehensive generated thing run the script you'll add? |
I've run these on my implementation. They all pass. |
Keywords that are only in effect with instance data of one type should never
interfere with keywords that require a different instance type. In particular,
implementations should not attempt to infer the type of the instance data
based on the keywords used by the schema.
The draft2019-09 data was generated with the script below. Drafts 6 and 7 were slightly adjusted by swapping out 'dependentRequired' and 'dependentSchemas' for 'dependencies'; draft4 removed the use of exclusiveMaximum and exclusiveMinimum because in this draft they require the presence of maximum or minimum. All combinations of keywords appear here, so long as the keywords require a different core data type; for each schema, four sets of data are created, representing the two data types expected by the schema, with a passing and failing test for each.