Skip to content

CBORPath proposal + implementation in Rust #90

Open
@mcatanzariti

Description

@mcatanzariti

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions