I have a very simple REST API (Spring-Boot) which should accept a list of strings as query parameters:
@ApiOperation(value = "Get the value drivers for a part by its as JSON output")
@GetMapping(AppConstants.VDJSON)
ValueDriver getValueDriverJson(
@RequestParam(value="pnrList")
final ArrayList<String> pnrList);
This generates a swagger output like this:
"/vdbptool/api/v1/vdjson": {
"get": {
"tags": [
"value-driver-codes-controller"
],
"summary": "Get the value drivers for a part by its PNR in LIST format as JSON output",
"operationId": "getValueDriverJsonUsingGET",
"parameters": [
{
"name": "pnrList",
"in": "query",
"description": "pnrList",
"required": true,
"style": "form",
"explode": true,
"schema": {
"type": "string"
}
}
],.
in swagger ui this looks like
The problem seems to be the type of the parameter, which is "string" instead of "array" - whatever I have tried.
My Gradle:
dependencies {
...
implementation 'io.springfox:springfox-boot-starter:3.0.0'
implementation 'io.springfox:springfox-oas:3.0.0'
What am I missing here in order to get the proper parameter type ("array") generated into the OAS 3.0 spec via Springfox ...?