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

jer: Unwrapped root #151

Merged
merged 3 commits into from
Dec 10, 2023
Merged

jer: Unwrapped root #151

merged 3 commits into from
Dec 10, 2023

Conversation

v0-e
Copy link

@v0-e v0-e commented Dec 8, 2023

Currently the JER encoding of any definition adds a wrapper object to it. This is not inline with X.697 (see encoded JSON examples in the standard, or check Nokalva's playground).
This PR removes this wrapper.

For example, consider the definitions:

  • A ::= SEQUENCE {a0 INTEGER, a1 INTEGER}
  • B ::= SEQUENCE OF INTEGER

The old/new behaviours are, (I've here removed the whitespaces still added by the encoder):
Old behaviour encoding:

  • {"A": {"a0":123, "a1": 456}}
  • {"B":[ {"INTEGER":1}, {"INTEGER":2}, {"INTEGER":3} ]}

New behaviour encoding:

  • {"a0":123, "a1": 456}
  • [1,2,3]

While this new encoding is arguably worse from a user/application standpoint since it does not provide the name of the definition in the encoded JSON, it should increase interoperability with other JER encoders/decoders.
This change also enables a more natural decoder implementation.

This PR also includes the support for JSON-compliant escapes in strings, and also enables randomized tests for JER.
I've chosen to include both of these features here because they depend on the new changes to the encoder/decoder.

@mouse07410 mouse07410 merged commit 26bd22f into mouse07410:vlm_master Dec 10, 2023
1 check passed
@v0-e v0-e deleted the jer-root-fix branch December 18, 2023 17:35
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.

2 participants