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

Spec for array inside array #82

Open
wyattleetech opened this issue Jul 31, 2018 · 1 comment
Open

Spec for array inside array #82

wyattleetech opened this issue Jul 31, 2018 · 1 comment

Comments

@wyattleetech
Copy link

Hi, I am straggling to define a spec to transform a json with an array inside an array. Here is the original json:
{
"contents": [
{
"id": 1,
"name": "aaa1",
"members": [
{
"member_id": 11,
"member_name": "bbb1"
},
{
"member_id": 12,
"member_name": "ccc1"
}
]
},
{
"id": 2,
"name": "aaa2",
"members": [
{
"member_id": 21,
"member_name": "bbb2"
},
{
"member_id": 22,
"member_name": "ccc2"
}
]
}
],
"meta": {
"meta1": "mmm1",
"meta2": "mmm2"
}
}

And here is the expected json:
{
"contents": [
{
"c_id": 1,
"c_name": "aaa1",
"members": [
{
"mem_id": 11,
"mem_name": "bbb1"
},
{
"mem_id": 12,
"mem_name": "ccc1"
}
]
},
{
"c_id": 2,
"c_name": "aaa2",
"members": [
{
"mem_id": 21,
"mem_name": "bbb2"
},
{
"mem_id": 22,
"mem_name": "ccc2"
}
]
}
],
"meta": {
"c_meta1": "mmm1",
"c_meta2": "mmm2"
}
}

Can any one help me with the spec? Thanks!

@henry-megarry
Copy link

@wyattleetech I have a similar situation did you ever figure out how to do this?

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

2 participants