Open ghost opened 6 years ago
I wonder if the example field should be allowed to have $refs in it.
example
$ref
In my app, there's a nested map type, let's call it FruitCartConfig:
FruitCartConfig
type FruitCartConfig struct { fruits map[string]FruitConfig } type FruitConfig struct { values map[string]string }
This allows me to make 1 API call that configures many fruits with many key-value pairs.
The example JSON I want to use is something like
{ "definitions": { "FruitCartConfig": { ... "properties": { "fruits": { ... "example": {"apple": {"$ref": "#/definitions/FruitConfig"}} } } }, "FruitConfig": { ... "properties": { "values": { ... "example": {"color": "red"} } } } } }
which would end up generating the example shown in the output
{ "fruits": { "apple": { "values": { "color": "red" } } } }
Any thoughts on this?
This would be a great feature to have. I'll mark it as a feature request and maybe somebody would like to pick it up.
I wonder if the
example
field should be allowed to have$ref
s in it.In my app, there's a nested map type, let's call it
FruitCartConfig
:This allows me to make 1 API call that configures many fruits with many key-value pairs.
The example JSON I want to use is something like
which would end up generating the example shown in the output
Any thoughts on this?