Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support parameterized collections as api parameters #7

Open
conorroche opened this issue Aug 15, 2014 · 6 comments
Open

support parameterized collections as api parameters #7

conorroche opened this issue Aug 15, 2014 · 6 comments
Assignees
Milestone

Comments

@conorroche
Copy link

support parameterized collections as api parameters

@conorroche conorroche self-assigned this Aug 15, 2014
@conorroche conorroche added this to the 1.1 release milestone Aug 15, 2014
@filip-java
Copy link

+1 on this feature :)

@conorroche
Copy link
Author

@deslauriersp can you give me more detail on this e.g. example of your method signature and what form the http request should take to pass the list/array parameter? It looks like the swagger 1.2 spec does not handle array parameters well e.g. handle different formats of multi valued params like &p1=val1&p1=val2 versus &p1[]=val1&p1[]=val2 versus &p1=val1,val2 the latter CSV one appears to be the main one supported by the UI for the 1.2 spec..

@filip-java
Copy link

Given your question, maybe I misunderstood what was the issue #7 about.
My issue is with collections in body parameter, not csv parameter. For a given method :

@Path("example") public Response doSomething(MyObject param){...}

json model generation works. But it fails for collections (with or without @inputType)

/**
*@inputType java.util.List<com.domaoin.MyObject>
*/

@Path("example")
public Response doSomething(List<MyObject> paramList){...}

@conorroche
Copy link
Author

@deslauriersp your use case should be supported e.g. i have a test for this that works:

@post
@path("/listofitems")
public void setListOfItems(List items) {
// noop
}

are you sure you aren't missing a http method like @post?

After looking back into this it isn't arrays that I was thinking of but rather a generic parameter class e.g. Gen and with a method like postVal(List<Gen> x)

@ghost
Copy link

ghost commented Sep 20, 2016

duplicates #136

@ghost
Copy link

ghost commented Oct 8, 2016

also duplicates conorroche#10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants