Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import swagger.SwaggerUtils.ApiAction;
{{#operations}}
public class {{classname}}Controller extends Controller {

private {{classname}}ControllerImp imp;
private ObjectMapper mapper;
private final {{classname}}ControllerImp imp;
private final ObjectMapper mapper;

@Inject
private {{classname}}Controller({{classname}}ControllerImp imp) {
Expand All @@ -42,8 +42,7 @@ public class {{classname}}Controller extends Controller {
public Result {{operationId}}({{#pathParams}}{{>pathParams}}{{#hasMore}},{{/hasMore}}{{/pathParams}}) {{^handleExceptions}}{{#bodyParams}}throws IOException{{/bodyParams}}{{/handleExceptions}}{{#handleExceptions}}throws Exception{{/handleExceptions}} {
{{#bodyParams}}
{{#collectionFormat}}
//TODO: Maybe implement this in the future if we can support collection in the body params: see bug in swagger-play: https://github.com/swagger-api/swagger-play/issues/130
//TODO: Tt seems it is not detected that it's a list based on the collectionFormat field?
//TODO: Support this later
{{/collectionFormat}}
{{^collectionFormat}}
JsonNode node{{paramName}} = request().body().asJson();
Expand All @@ -60,9 +59,7 @@ public class {{classname}}Controller extends Controller {
{{/bodyParams}}
{{#queryParams}}
{{#collectionFormat}}
//TODO: Maybe implement this in the future if we can support collection in the body params: see bug in swagger-play: https://github.com/swagger-api/swagger-play/issues/130
//TODO: Tt seems it is not detected that it's a list based on the collectionFormat field?
//WIP when both bugs will be fixed
//TODO: Support this later
//List<Pair> {{paramName}}Pair = SwaggerUtils.parameterToPairs("{{collectionFormat}}", "{{paramName}}", request().getQueryString("{{baseName}}"));
{{{dataType}}} {{paramName}} = new Array{{{dataType}}}();
//for (Pair pair : {{paramName}}Pair) {
Expand Down Expand Up @@ -92,9 +89,7 @@ public class {{classname}}Controller extends Controller {
{{/notFile}}
{{#notFile}}
{{#collectionFormat}}
//TODO: Maybe implement this in the future if we can support collection in the body params: see bug in swagger-play: https://github.com/swagger-api/swagger-play/issues/130
//TODO: Tt seems it is not detected that it's a list based on the collectionFormat field?
//WIP when both bugs will be fixed
//TODO: Support this later
//List<Pair> {{paramName}}Pair = SwaggerUtils.parameterToPairs("{{collectionFormat}}", "{{paramName}}", ((String[]) request().body().asMultipartFormData().asFormUrlEncoded().get("{{baseName}}"))[0]);
{{{dataType}}} {{paramName}} = new Array{{{dataType}}}();
//for (Pair pair : {{paramName}}Pair) {
Expand All @@ -117,9 +112,7 @@ public class {{classname}}Controller extends Controller {
{{/formParams}}
{{#headerParams}}
{{#collectionFormat}}
//TODO: Maybe implement this in the future if we can support collection in the body params: see bug in swagger-play: https://github.com/swagger-api/swagger-play/issues/130
//TODO: Tt seems it is not detected that it's a list based on the collectionFormat field?
//WIP when both bugs will be fixed
//TODO: Support this later
//List<Pair> {{paramName}}Pair = SwaggerUtils.parameterToPairs("{{collectionFormat}}", "{{paramName}}", request().getHeader("{{baseName}}"));
//{{{dataType}}} {{paramName}} = new Array{{{dataType}}}();
//for (Pair pair : {{paramName}}Pair) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{#isInteger}}0{{/isInteger}}{{#isDouble}}0.0{{/isDouble}}{{#isLong}}0L{{/isLong}}{{#isFloat}}0.0{{/isFloat}}{{#isString}}""{{/isString}}
{{#isBoolean}}false{{/isBoolean}}{{#isInteger}}0{{/isInteger}}{{#isDouble}}0.0{{/isDouble}}{{#isLong}}0L{{/isLong}}{{#isFloat}}0.0{{/isFloat}}{{#isString}}""{{/isString}}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

public class PetApiController extends Controller {

private PetApiControllerImp imp;
private ObjectMapper mapper;
private final PetApiControllerImp imp;
private final ObjectMapper mapper;

@Inject
private PetApiController(PetApiControllerImp imp) {
Expand Down Expand Up @@ -62,9 +62,7 @@ public Result deletePet(Long petId) throws Exception {

@ApiAction
public Result findPetsByStatus() throws Exception {
//TODO: Maybe implement this in the future if we can support collection in the body params: see bug in swagger-play: https://github.com/swagger-api/swagger-play/issues/130
//TODO: Tt seems it is not detected that it's a list based on the collectionFormat field?
//WIP when both bugs will be fixed
//TODO: Support this later
//List<Pair> statusPair = SwaggerUtils.parameterToPairs("csv", "status", request().getQueryString("status"));
List<String> status = new ArrayList<String>();
//for (Pair pair : statusPair) {
Expand All @@ -78,9 +76,7 @@ public Result findPetsByStatus() throws Exception {

@ApiAction
public Result findPetsByTags() throws Exception {
//TODO: Maybe implement this in the future if we can support collection in the body params: see bug in swagger-play: https://github.com/swagger-api/swagger-play/issues/130
//TODO: Tt seems it is not detected that it's a list based on the collectionFormat field?
//WIP when both bugs will be fixed
//TODO: Support this later
//List<Pair> tagsPair = SwaggerUtils.parameterToPairs("csv", "tags", request().getQueryString("tags"));
List<String> tags = new ArrayList<String>();
//for (Pair pair : tagsPair) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

public class StoreApiController extends Controller {

private StoreApiControllerImp imp;
private ObjectMapper mapper;
private final StoreApiControllerImp imp;
private final ObjectMapper mapper;

@Inject
private StoreApiController(StoreApiControllerImp imp) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

public class UserApiController extends Controller {

private UserApiControllerImp imp;
private ObjectMapper mapper;
private final UserApiControllerImp imp;
private final ObjectMapper mapper;

@Inject
private UserApiController(UserApiControllerImp imp) {
Expand Down