byoungman I think you should update the JSON Model returned to your endpoint to something like this:
{
"results": [
{
"value": "Company Zero",
"matches": {
"matchedNameId": "2861495",
}
},
{
"value": "Company One",
"matches": {
"matchedNameId": "3423310",
}
},
]
"metrics": {
"metric_one": "value"
}
}
You don't want your client to be relying on specific key values such as "value0" or "matches0" because that can't be modeled in the spec (it is dynamic depending on search results) so you want to group those two things into one object.
The JSON I wrote out for you can be modelled like this in Open API:
responses:
'200':
description: OK
content:
'application/json:':
schema:
type: array
items:
type: $ref/components/schemas/MyResponse
components:
schemas:
MyResponse:
properties:
result:
schema:
type: array
items:
properties:
value: string
matches: "$ref/components/schemas/MyResponseMatch"
metrics:"$ref/components/schemas/MyMetricsObj" # not shown
MyResponseMatch:
schema:
type: object
properties:
matchNameId: string