Skip to content

Instantly share code, notes, and snippets.

@ptwohig
Last active September 30, 2015 18:03
Show Gist options
  • Save ptwohig/407080950fb0f7cb9462 to your computer and use it in GitHub Desktop.
Save ptwohig/407080950fb0f7cb9462 to your computer and use it in GitHub Desktop.
class Foo {
private String bar;
}
class Container<ContainedT> {
private List<Contained>T objects;
}
public class Resource {
// This case Swagger shows the return model as something like this
// [
// { "bar" : "string" }
// ]
@ApiOperation
List<Foo> getListOfFoo() {return theList;}
// This case Swagger shows the return model as something like this
// {
// "objects" : [ ... ]
// }
// WHen I actually want it to show something like...
// {
// "objects" : [ { "bar" : "string" } ]
// }
@ApiOperation
Container<Foo> getContainerOfFoo() {return theContainer;}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment