The current annotation I'm using is as follows:
@OpenApi(
summary = "Update Camera",
tags = ["Camera"],
formParams = [
OpenApiFormParam(name = "groupIds", type = List::class, required = true)
]
)
Swagger correctly identifies groupIds
as being an array parameter, but when I run this line of code
fun updateCamera(context: Context) {
val groupIds = context.formParams("groupIds")
...
}
I just get a in the form ["GroupId1,GroupId2,GroupId3"]
with one string entry where each input groupId
is separated by a comma. I would like a list with a separate entry for each input groupId
as follows ["GroupId1", "GroupId2", "GroupId3"]
.
I could just split the string by commas, but I would prefer not to do this in the case that a groupId is input that contains a comma. How do I ensure that the array has been properly transformed into the correct JSON format?