Swagger UI script not compiling multiple QueryParam's

37 views
Skip to first unread message

kiran v

unread,
Jan 16, 2017, 1:04:45 PM1/16/17
to Swagger
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!

Ron Ratovsky

unread,
Jan 16, 2017, 1:18:13 PM1/16/17
to swagger-sw...@googlegroups.com

Please open a ticket on swagger-ui, mentioning the version you use and providing us with a full spec so we can test it.

--
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 swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

frazierj...@yahoo.com

unread,
Jan 16, 2017, 9:00:25 PM1/16/17
to swagger-sw...@googlegroups.com

--------------------------------------------
On Mon, 1/16/17, Ron Ratovsky <r...@swagger.io> wrote:

Subject: Re: Swagger UI script not compiling multiple QueryParam's
To: "swagger-sw...@googlegroups.com" <swagger-sw...@googlegroups.com>
Date: Monday, January 16, 2017, 8:18 PM

#yiv6028342177
#yiv6028342177 --

_filtered #yiv6028342177 {font-family:Arial;panose-1:2 11 6
4 2 2 2 2 2 4;}
_filtered #yiv6028342177 {panose-1:2 7 3 9 2 2 5 2 4 4;}
_filtered #yiv6028342177 {panose-1:2 4 5 3 5 4 6 3 2 4;}
_filtered #yiv6028342177 {font-family:Calibri;panose-1:2 15
5 2 2 2 4 3 2 4;}
#yiv6028342177
#yiv6028342177 p.yiv6028342177MsoNormal, #yiv6028342177
li.yiv6028342177MsoNormal, #yiv6028342177
div.yiv6028342177MsoNormal
{margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;}
#yiv6028342177 a:link, #yiv6028342177
span.yiv6028342177MsoHyperlink
{color:blue;text-decoration:underline;}
#yiv6028342177 a:visited, #yiv6028342177
span.yiv6028342177MsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
#yiv6028342177 p
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;}
#yiv6028342177 pre
{margin:0cm;margin-bottom:.0001pt;font-size:10.0pt;}
#yiv6028342177 span.yiv6028342177apple-tab-span
{}
#yiv6028342177 span.yiv6028342177HTMLPreformattedChar
{font-family:Courier;}
#yiv6028342177 span.yiv6028342177EmailStyle21
{font-family:Calibri;color:windowtext;}
#yiv6028342177 span.yiv6028342177msoIns
{text-decoration:underline;color:teal;}
#yiv6028342177 .yiv6028342177MsoChpDefault
{font-size:10.0pt;}
_filtered #yiv6028342177 {margin:72.0pt 72.0pt 72.0pt
72.0pt;}
#yiv6028342177 div.yiv6028342177WordSection1
{}
#yiv6028342177 Please open a
ticket on swagger-ui, mentioning the version you use and
providing us with a full spec so we can test
it.
 
 
 
 From:
<swagger-sw...@googlegroups.com>
on behalf of kiran v <kiran....@gmail.com>
Reply-To:
"swagger-sw...@googlegroups.com"
<swagger-sw...@googlegroups.com>
Date: Monday, 16 January 2017 at
10:04
To: Swagger
<swagger-sw...@googlegroups.com>
Subject: Swagger UI script not compiling
multiple QueryParam's  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 =
preciere cu privire la evolutia economica a Romaniei in perioada interbelica

calde...@yahoo.com

unread,
Jan 16, 2017, 10:33:58 PM1/16/17
to swagger-sw...@googlegroups.com

--------------------------------------------
On Tue, 1/17/17, frazierjanice629 via Swagger <swagger-sw...@googlegroups.com> wrote:

Subject: Re: Swagger UI script not compiling multiple QueryParam's
To: swagger-sw...@googlegroups.com
Date: Tuesday, January 17, 2017, 3:57 AM
https://groups.google.com/d/optout.poi in Cehoslovacia.ian.- mart. - Uriasa presiune a comunistilor sprijiniti de sovietici pentru preluarea puterii.
Reply all
Reply to author
Forward
0 new messages