vlm / asn1c

The ASN.1 Compiler
http://lionet.info/asn1c/
BSD 2-Clause "Simplified" License
1.05k stars 559 forks source link

Support of JSON Encoding Rules #409

Open edbunet opened 4 years ago

edbunet commented 4 years ago

Hello, has anyone already implemented or tried to implement a JER encoder for asn1c? is it perhaps in the development roadmap? Thanks in advance for your answers.

jayshah3008 commented 3 years ago

JSON encoding support does not seems to be available directly. However, one of the hack is to use xml encoding and convert it to JSON with external libs.

mouse07410 commented 3 years ago

What external lib(s) do you have in mind?

jayshah3008 commented 3 years ago

You can use various platform specific xml to json converter libraries. For example xj in golang.

On Thu, 27 May 2021, 12:37 Mouse, @.***> wrote:

What external lib(s) do you have in mind?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vlm/asn1c/issues/409#issuecomment-849388928, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGMA3MMMMCGK2RIIGF2ELNLTPXVRTANCNFSM4TQ4MXIA .

jayshah3008 commented 3 years ago

Does this approach helps? Your thoughts on this?

edbunet commented 3 years ago

Hello, thank you for the suggestion. This is what I finally did. However, it is difficult to find good libraries that converts xml to json and also json to xml. In particular, it is difficult to find libraries that are compliant with Json Encoding Rules (JER) as defined in standard ITU X.697

mouse07410 commented 3 years ago

As far as I know, there's no (open source) library that converts to JER-compliant JSON.

If you know otherwise, please post here.