btalebpour
2 years agoOccasional Contributor
Defining a Dynamic JSON Object in Response
Hi there,
I am documenting our API by using Open API 3.0.3 and the Swagger editor. One of the get methods returns MongoDB indexes in the following format. I am wondering how I can define my response specifications:
```
[
{
"purl_-1": [
[
"purl",
-1
]
]
},
{
"cIndex_product_-1_price_-1": [
[
"product",
-1
],
[
"price",
-1
]
]
}
```
As you can see, the key part of the objects is the name of the index, which is built by combining all array items.