I'm trying to specify a field, someField
, in my swagger docs that is an array of objects. The objects should be key value pairs. The keys are strings with no required name, so a user can name his key whatever he wants. An example would like:
"someField": [{"whatever_key_I_want": "whatever_value_I_want"}, {"whatever_key_I_want2": "whatever_value_I_want2"}]
.
And this is what I've tried in my swagger yml accordingly.
someField:
type: array
description: This is an array of objects in the form of key-value pairs
items:
type: object
description: a key value pair
x-c1-example:
any_key_you_want: any_value_you_want
For some reason, though, in the swagger ui, the example shows up as:
someField: ["any_key_you_want"=> "any_value_you_want"]
instead of someField: ["any_key_you_want": "any_value_you_want"]
.
Why is :
getting changed to =>
? How can I fix this?