Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json support #9

Open
Hadatko opened this issue Dec 19, 2019 · 1 comment
Open

json support #9

Hadatko opened this issue Dec 19, 2019 · 1 comment

Comments

@Hadatko
Copy link

Hadatko commented Dec 19, 2019

Would be nice to have chance to get output in json type.
result.toJSON() =>
{'type':'struct', 'name':'structName','members':[{...},{...}]}
or
{'type':'struct', 'name':'structName','members':{'paam1':{...},'paam2':{...},...}}

@Hadatko
Copy link
Author

Hadatko commented Dec 20, 2019

struct definition

struct B
{
    uint16_t a;
};
struct A
{
    struct B b[2];
};

B.a = 5
A.b=[5,5] //A.b[0].a=5;A.b[1].a=5;

json example for B:

{
    "B": {
        "a": {
            "type": "uint16",
            "value": 5
        }
    }
}

json example for A:

{
    "A": {
        "b": {
            "type": "B",
            "value": [{
                "a": {
                    "type": "uint16",
                    "value": 5
                }
            }, {
                "a": {
                    "type": "uint16",
                    "value": 5
                }
            }]
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant