Skip to content

ref: test empty tokens in json-pointer #664

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

Merged
merged 2 commits into from
Apr 21, 2023
Merged

ref: test empty tokens in json-pointer #664

merged 2 commits into from
Apr 21, 2023

Conversation

santhosh-tekuri
Copy link
Contributor

@santhosh-tekuri santhosh-tekuri commented Apr 3, 2023

I added the test to just draft4.
if the test looks fine. will add to remaining drafts.

the test passes with my impl https://github.com/santhosh-tekuri/boon

FYI: for example java.util.StringTokenizer does not return empty tokens.

@santhosh-tekuri santhosh-tekuri requested a review from a team as a code owner April 3, 2023 14:34
@gregsdennis
Copy link
Member

gregsdennis commented Apr 18, 2023

I don't support draft 4. Can you go ahead and add to draft 6 so I can run it, please? (also needs a rebase)

This looks like a valid test to me.

Copy link
Member

@jdesrosiers jdesrosiers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works on my implementation

@santhosh-tekuri
Copy link
Contributor Author

added tests in remaining drafts

Copy link
Member

@gregsdennis gregsdennis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. These all work for me.

The check that's failing is requiring that all schemas have $id (id for draft 4). If you can add those, I'll go ahead and merge.

@santhosh-tekuri
Copy link
Contributor Author

santhosh-tekuri commented Apr 21, 2023

@gregsdennis added $id to schemas

the check still seems to be failing

@gregsdennis
Copy link
Member

I'm sorry. I assumed that was the problem, but it's not.

The error is:

AssertionError: is not a known keyword for draft2020-12. If this test is testing behavior related to unknown keywords you may need to add it to the allowlist in the jsonschema_suite checker. Otherwise it may contain a typo!

It looks like the check is trying to validate the definition "" key as a keyword. @Julian/@jdesrosiers do you know about this?

@santhosh-tekuri
Copy link
Contributor Author

let me know if $id added has to be removed

@Julian
Copy link
Member

Julian commented Apr 21, 2023

The sanity check is somewhat brutish, essentially because doing what it wants to do in general for this is hard -- yes there is no reason you need an $id, that's not required by the spec. I can look at why it's confused by this case in a bit.

@Julian
Copy link
Member

Julian commented Apr 21, 2023

The commit I pushed should fix this (yes please remove the IDs when they're not needed).

@santhosh-tekuri
Copy link
Contributor Author

removed '$id' from schemas

@Julian
Copy link
Member

Julian commented Apr 21, 2023

(You removed the fix commit, you'll need to cherry pick it back)

@santhosh-tekuri
Copy link
Contributor Author

@Julian not sure how to do cherry picking. trying it from google

@Julian
Copy link
Member

Julian commented Apr 21, 2023

If you pulled before force pushing, just run git cherry-pick a81ddee and then push. If you didn't, run git pull first then run that and hopefully that works I forget, if the commit is not on any branch GitHub may not send it to you -- if so I'll repush it when I get back to a computer.

@santhosh-tekuri
Copy link
Contributor Author

I did not pull your change, before I did force push. now a81ddee is not showing up in my repo

@santhosh-tekuri
Copy link
Contributor Author

@Julian I took diff from your commit and applied it.

@santhosh-tekuri
Copy link
Contributor Author

I reverted my change. please recommit your change when you are back. sorry for the confusion.

The test in this PR (#664) actually trips a bug in the older version
(where it doesn't properly consider the keys in definitions to not be
schemas, they're just labels)
@Julian
Copy link
Member

Julian commented Apr 21, 2023

(Re-pushed.)

@gregsdennis
Copy link
Member

I think we're good now. Thanks @Julian. I'm going to go ahead and merge.

@gregsdennis gregsdennis merged commit 6afa9b3 into json-schema-org:main Apr 21, 2023
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