Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.