Optional CSV parameters rendered incorrectly in the Swagger
Apologies if this issue has been reported before but I couldn't find any issues open or closed covering this.
We have an optional CSV field on our API e.g.
param[Option[Seq[String]]]("ids")
However the parameter in the swagger is rendered as
{
"name" : "foo",
"in" : "query",
"required" : false,
"type" : "array",
"items" : {
"type" : "List"
}
},
instead of
{
"name" : "foo",
"in" : "query",
"required" : false,
"type" : "array",
"items" : {
"type" : "string"
}
},
Note that we need this parameter to be optional in the swagger e.g. "required": false.
If the parameter is defined as param[Seq[String]]("ids") then the swagger definition shows the correct type, e.g. array with items of type string, but the required property is then true.
The issue seems to be that during the swagger generation the type traversal of the Option[Seq[String]] stops at the Seq and doesn't continue to identify the actual type of the items.
Awesome! Thanks for getting a fix in so quickly!
@zarthross I think this issue can be closed.