asn1c icon indicating copy to clipboard operation
asn1c copied to clipboard

Support of JSON Encoding Rules

Open edbunet opened this issue 5 years ago • 6 comments

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.

edbunet avatar Nov 10 '20 16:11 edbunet

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.

jayshah3008 avatar May 27 '21 04:05 jayshah3008

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

mouse07410 avatar May 27 '21 07:05 mouse07410

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 avatar May 27 '21 07:05 jayshah3008

Does this approach helps? Your thoughts on this?

jayshah3008 avatar May 27 '21 10:05 jayshah3008

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

edbunet avatar May 27 '21 13:05 edbunet

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

If you know otherwise, please post here.

mouse07410 avatar May 27 '21 13:05 mouse07410