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

CBORPath proposal + implementation in Rust #90

Open
mcatanzariti opened this issue Feb 5, 2023 · 1 comment
Open

CBORPath proposal + implementation in Rust #90

mcatanzariti opened this issue Feb 5, 2023 · 1 comment

Comments

@mcatanzariti
Copy link

mcatanzariti commented Feb 5, 2023

Based on the JSONPath Internet Draft, I recently wrote a CBORPath implementation in Rust: https://github.com/dahomey-technologies/cborpath-rs.

The main difference between JSONPath and my CBORPath proposal is that CBORPath is itself represented as a valid CBOR expression.

Pros:

  • Any valid CBOR value, including a byte string can be expressed in a CBORPath expression.
  • A CBOR map key can be any valid CBOR value, not only text like JSON object names. Consequently, the JSONPath name-selector is replaced by a CBORPath key-selector.
  • An existing CBOR parser or deserializer is enough to validate a CBORPath expression, no need to write neither a grammar nor a parser.

Cons:

  • A CBORPath expression is more verbose than the JSONPath equivalent

Thank you to give your thoughts about the proposal. I may take the time to write an Internet draft.

Michaël

PS: reddit post link

@cabo
Copy link
Contributor

cabo commented Feb 5, 2023

Interesting! I'll look at this in more detail, but doing something like this certainly was in the cards.
We'll have a JSONPath interim meeting on Tuesday and a CBOR interim meeting on Wednesday; I'll make sure that this work gets some mention there (even if there isn't an Internet-Draft1 to discuss yet).

Footnotes

  1. This is what we like to call our draft RFCs, because they aren't RFCs yet...

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

2 participants