I want to make a Model for request where some part of the request structure may change.
As i don't have uniform structure here. How can i define json
model for Amazon Api Gateway
?
Request:
Here data inside items.{index}.data
is changing according to type_id
. Also we are not sure about which item with perticular type_id
come at which {index}
. even the type of items.{index}.data
may change.
{
"name":"Jon Doe",
"items": [
{
"type_id":2,
"data": {
"km": 10,
"fuel": 20
}
},
{
"type_id": 5,
"data": [
[
"id":1,
"value":2
],
.....
]
},{
"type_id": 3,
"data": "data goes here"
},
....
]
}
How should i do this?