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:
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.
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.