Hello all,
Swagger UI script not compiling multiple QueryParam's.
Following are the details:
Config in java class:
@Path("submit")
@POST
@Consumes(MediaType.TEXT_PLAIN)
@Produces(MediaType.TEXT_PLAIN)
@ApiOperation(value = "Submit ", notes = "")
@ApiResponses(value = {@ApiResponse(code = 500, message = "Internal Server
Error") })
@Override
public Response processSubmit(
@ApiParam(value = "Enrolled Submiter id", required = true)
@QueryParam("FIELD1") final String field1,
@ApiParam(value = "", required = true) final String content,
@ApiParam(value = "", required = true, allowMultiple= true)
@QueryParam("EXTRA") final List<String> list)
{
JSON:
{
"swagger": "2.0",
"info": {
"title": "API"
},
"basePath": "/xxx/yy,
"tags": [{
"name": "API Methods: Health Checks"
},
{
"name": "API Methods: Submit"
}],
"paths": {
"/meta/version": {
"get": {
"tags": ["API Methods: Health Checks"],
"summary": "Version Resource",
"description": "This is the version resource",
"operationId": "getVersion",
"produces": ["text/html"],
"parameters": [],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "string"
}
}
}
}
},
"/": {
"get": {
"tags": ["API Methods: Health Checks"],
"summary": "Root Resource",
"description": "This is the root resource",
"operationId": "intialPage",
"produces": ["text/html"],
"parameters": [],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "string"
}
}
}
}
},
"/meta/availability": {
"get": {
"tags": ["API Methods: Health Checks"],
"summary": "Availability Resource",
"description": "This is the availability resource",
"operationId": "getAvailability",
"produces": ["text/html"],
"parameters": [],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "string"
}
}
}
}
},
"/submit": {
"post": {
"tags": ["API Methods: Submit"],
"summary": "Submit ",
"description": "xxxxx",
"operationId": "processSubmit",
"consumes": ["text/plain"],
"produces": ["text/plain"],
"parameters": [{
"name": "FIELD1",
"in": "query",
"description": "field",
"required": true,
"type": "string"
},
{
"in": "body",
"name": "body",
"description": "",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "EXTRA",
"in": "query",
"description": "saasas",
"required": true,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "multi"
}],
"responses": {
"500": {
"description": "Internal Server Error"
}
}
}
}
}
}
Swagger UI:
curl -X POST --header 'Content-Type: text/plain' --header 'Accept: text/plain'
-d 'testing'
'http://xxxxxxxxxxxxxxx:9080/edi/messaging/submit?FIELD1=FIELD1&EXTRA=test1&EXTRA=test2'
It looks like Curl Command is correctly generated so i assume we are
configuring APIParam correctly, but when I hit send ,the host server is
receiving only one param and missing second query parameter. when I copy
the swaggerUI curl command and ran it from command prompt, it is working as
excepted.
I was thinking swagger UI not compiling the second query parameter
appropriately.
If there is something missing in my annotation that will enable swaggerUI
to compile it differently?
Any help would be greatly appreciated.
Thanks!
--
You received this message because you are subscribed to the Google Groups
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.