Skip to content
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

JSON Pointers single prefix limitation #21

Open
chrisgblr opened this issue Mar 31, 2023 · 2 comments
Open

JSON Pointers single prefix limitation #21

chrisgblr opened this issue Mar 31, 2023 · 2 comments

Comments

@chrisgblr
Copy link

Would be very helpful if this limitation could be lifted:

Important: You can only use a pointer prefix once in a class. For example, you can't use /user and /user/name in the same class.

@JulianBissekkou
Copy link

@simc Can you explain why that is?
I never used json pointers before, but using multiple pointers sounds like a valid use case for me 🤔

@simc
Copy link
Owner

simc commented Jun 29, 2023

@JulianBissekkou pointers basically allow you easily and very efficiently unwrap nested json. Check out the example in the readme.

Using a pointer prefix multiple times is definitely a valid use case but very difficult to implement. Crimson has the distinct advantage to only need a single pass to parse bytes directly to objects. To use a prefix multiple times while maintaining the single pass advantage would require a complex state machine to keep track of different paths. I'm currently not sure how to implement it and whether it will be faster or slower than parsing the entire objects.

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

No branches or pull requests

3 participants