Overview

This chapter discusses the code generated for encoding and decoding JSON data.

As of version 7.3, ASN1C supports ITU-T X.697 JER.

As of version 7.4, the -jer+ option generates code for JER with some ObjSys extensions/revisions. In particular, the encoder will encode a content-constrained BIT STRING or OCTET STRING as the contained type, inside a wrapper, rather than as a BIT STRING or OCTET STRING (which would use a hexadecimal representation). The decoder will successfully decode values encoded in either the extended format or in the standard JER format. The extended format is a JSON object with a value named "value+" where the value is the normal JER encoding of the contained type. For example:

"bit-string-field" : {
            "value+" : <JER encoding of contained type>
            }

Note

BACKWARD COMPATIBILITY: Prior to 7.3 (and starting with asn1c 6.6), asn1c used proprietary encoding rules for JSON, as this work predated the development of ITU-T X.697. If you need to work with our proprietary encoding rules, you must use the command-line arguments -compat 729 (or an older version number). We urge you to upgrade to using X.697 JER.

Our proprietary rules, and differences with X.697, are available on our website.