I want to model a schema where response is dictionary of dictionaries:
{
'id1': {
'type': 'type1',
'active': true,
},
'id2': {
'type': 'type2',
'active': false,
},
...
...
}
I have defined:
components:
schemas:
accountData:
type: object
required:
- type
- active
properties:
type:
type: string
active:
type: boolean
accounts:
type: object
additionalProperties:
type: object
properties:
account-id:
type: object
$ref: '#/components/schemas/accountData'
Now I want to define '#/components/schemas/accounts' which is a repeating dictionary of '#/components/schemas/account'.
I am very new to OpenApi 3, I am unable to figure out how to do it.