diff --git a/bin/jaxrs-jersey1-petstore-server.sh b/bin/jaxrs-jersey1-petstore-server.sh index 13938c8d1eb..f04b6b9f3d1 100755 --- a/bin/jaxrs-jersey1-petstore-server.sh +++ b/bin/jaxrs-jersey1-petstore-server.sh @@ -26,7 +26,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs -o samples/server/petstore/jaxrs/jersey1 -DhideGenerationTimestamp=true,serverPort=8080 --library=jersey1 --artifact-id=swagger-jaxrs-jersey1-server" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs -o samples/server/petstore/jaxrs/jersey1 -DhideGenerationTimestamp=true,serverPort=8080 --library=jersey1 --artifact-id=swagger-jaxrs-jersey1-server" echo "Removing files and folders under samples/server/petstore/jaxrs/jersey1/src/main" rm -rf samples/server/petstore/jaxrs/jersey1/src/main diff --git a/bin/jaxrs-jersey1-usetags-petstore-server.sh b/bin/jaxrs-jersey1-usetags-petstore-server.sh index 07a5f67a8f5..b115995f6f2 100755 --- a/bin/jaxrs-jersey1-usetags-petstore-server.sh +++ b/bin/jaxrs-jersey1-usetags-petstore-server.sh @@ -26,7 +26,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs -o samples/server/petstore/jaxrs/jersey1-useTags -DhideGenerationTimestamp=true,serverPort=8080 --library=jersey1 --artifact-id=swagger-jaxrs-jersey1-useTags --additional-properties useTags=true" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs -o samples/server/petstore/jaxrs/jersey1-useTags -DhideGenerationTimestamp=true,serverPort=8080 --library=jersey1 --artifact-id=swagger-jaxrs-jersey1-useTags --additional-properties useTags=true" echo "Removing files and folders under samples/server/petstore/jaxrs/jersey1-useTags/src/main" rm -rf samples/server/petstore/jaxrs/jersey1-useTags/src/main diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index 87003c82e9c..e510994a74a 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -639,16 +639,7 @@ public String toDefaultValue(Property p) { return null; } - String typeDeclaration = getTypeDeclaration(ap.getItems()); - Object java8obj = additionalProperties.get("java8"); - if (java8obj != null) { - Boolean java8 = Boolean.valueOf(java8obj.toString()); - if (java8 != null && java8) { - typeDeclaration = ""; - } - } - - return String.format(pattern, typeDeclaration); + return String.format(pattern, getTypeDeclaration(ap.getItems())); } else if (p instanceof MapProperty) { final MapProperty ap = (MapProperty) p; final String pattern; @@ -661,16 +652,7 @@ public String toDefaultValue(Property p) { return null; } - String typeDeclaration = String.format("String, %s", getTypeDeclaration(ap.getAdditionalProperties())); - Object java8obj = additionalProperties.get("java8"); - if (java8obj != null) { - Boolean java8 = Boolean.valueOf(java8obj.toString()); - if (java8 != null && java8) { - typeDeclaration = ""; - } - } - - return String.format(pattern, typeDeclaration); + return String.format(pattern, String.format("String, %s", getTypeDeclaration(ap.getAdditionalProperties()))); } else if (p instanceof IntegerProperty) { IntegerProperty dp = (IntegerProperty) p; if (dp.getDefault() != null) { diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java index 1b753f8ebe0..ab1ddb7ea82 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java @@ -140,6 +140,15 @@ public Map postProcessOperations(Map objs) { @SuppressWarnings("unchecked") List ops = (List) operations.get("operation"); for ( CodegenOperation operation : ops ) { + if (operation.hasConsumes == Boolean.TRUE) { + Map firstType = operation.consumes.get(0); + if (firstType != null) { + if ("multipart/form-data".equals(firstType.get("mediaType"))) { + operation.isMultipart = Boolean.TRUE; + } + } + } + boolean isMultipartPost = false; List> consumes = operation.consumes; if(consumes != null) { @@ -166,39 +175,32 @@ public Map postProcessOperations(Map objs) { resp.code = "200"; } - // set vendorExtensions.x-java-is-response-void to true as dataType is set to "void" - if (resp.dataType == null) { + if (resp.baseType == null) { + resp.dataType = "void"; + resp.baseType = "Void"; + // set vendorExtensions.x-java-is-response-void to true as baseType is set to "Void" resp.vendorExtensions.put("x-java-is-response-void", true); } + if ("array".equals(resp.containerType)) { + resp.containerType = "List"; + } else if ("map".equals(resp.containerType)) { + resp.containerType = "Map"; + } } } - if ( operation.returnType == null ) { + if ( operation.returnBaseType == null ) { operation.returnType = "void"; - // set vendorExtensions.x-java-is-response-void to true as returnType is set to "void" + operation.returnBaseType = "Void"; + // set vendorExtensions.x-java-is-response-void to true as returnBaseType is set to "Void" operation.vendorExtensions.put("x-java-is-response-void", true); - } else if ( operation.returnType.startsWith("List") ) { - String rt = operation.returnType; - int end = rt.lastIndexOf(">"); - if ( end > 0 ) { - operation.returnType = rt.substring("List<".length(), end).trim(); - operation.returnContainer = "List"; - } - } else if ( operation.returnType.startsWith("Map") ) { - String rt = operation.returnType; - int end = rt.lastIndexOf(">"); - if ( end > 0 ) { - operation.returnType = rt.substring("Map<".length(), end).split(",")[1].trim(); - operation.returnContainer = "Map"; - } - } else if ( operation.returnType.startsWith("Set") ) { - String rt = operation.returnType; - int end = rt.lastIndexOf(">"); - if ( end > 0 ) { - operation.returnType = rt.substring("Set<".length(), end).trim(); - operation.returnContainer = "Set"; - } + } + + if ("array".equals(operation.returnContainer)) { + operation.returnContainer = "List"; + } else if ("map".equals(operation.returnContainer)) { + operation.returnContainer = "Map"; } } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyEapServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyEapServerCodegen.java index f9c9cad1380..50f6511ff33 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyEapServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyEapServerCodegen.java @@ -133,54 +133,7 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera @Override public Map postProcessOperations(Map objs) { - - Map operations = (Map) objs.get("operations"); - if (operations != null) { - List ops = (List) operations.get("operation"); - for (CodegenOperation operation : ops) { - if (operation.hasConsumes == Boolean.TRUE) { - Map firstType = operation.consumes.get(0); - if (firstType != null) { - if ("multipart/form-data".equals(firstType.get("mediaType"))) { - operation.isMultipart = Boolean.TRUE; - } - } - } - List responses = operation.responses; - if (responses != null) { - for (CodegenResponse resp : responses) { - if ("0".equals(resp.code)) { - resp.code = "200"; - } - } - } - if (operation.returnType == null) { - operation.returnType = "Void"; - } else if (operation.returnType.startsWith("List")) { - String rt = operation.returnType; - int end = rt.lastIndexOf(">"); - if (end > 0) { - operation.returnType = rt.substring("List<".length(), end).trim(); - operation.returnContainer = "List"; - } - } else if (operation.returnType.startsWith("Map")) { - String rt = operation.returnType; - int end = rt.lastIndexOf(">"); - if (end > 0) { - operation.returnType = rt.substring("Map<".length(), end).split(",")[1].trim(); - operation.returnContainer = "Map"; - } - } else if (operation.returnType.startsWith("Set")) { - String rt = operation.returnType; - int end = rt.lastIndexOf(">"); - if (end > 0) { - operation.returnType = rt.substring("Set<".length(), end).trim(); - operation.returnContainer = "Set"; - } - } - } - } - return objs; + return super.postProcessOperations(objs); } @Override diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyServerCodegen.java index 7627884c407..4e9241a91cf 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyServerCodegen.java @@ -132,54 +132,7 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera @Override public Map postProcessOperations(Map objs) { - - Map operations = (Map) objs.get("operations"); - if (operations != null) { - List ops = (List) operations.get("operation"); - for (CodegenOperation operation : ops) { - if (operation.hasConsumes == Boolean.TRUE) { - Map firstType = operation.consumes.get(0); - if (firstType != null) { - if ("multipart/form-data".equals(firstType.get("mediaType"))) { - operation.isMultipart = Boolean.TRUE; - } - } - } - List responses = operation.responses; - if (responses != null) { - for (CodegenResponse resp : responses) { - if ("0".equals(resp.code)) { - resp.code = "200"; - } - } - } - if (operation.returnType == null) { - operation.returnType = "Void"; - } else if (operation.returnType.startsWith("List")) { - String rt = operation.returnType; - int end = rt.lastIndexOf(">"); - if (end > 0) { - operation.returnType = rt.substring("List<".length(), end).trim(); - operation.returnContainer = "List"; - } - } else if (operation.returnType.startsWith("Map")) { - String rt = operation.returnType; - int end = rt.lastIndexOf(">"); - if (end > 0) { - operation.returnType = rt.substring("Map<".length(), end).split(",")[1].trim(); - operation.returnContainer = "Map"; - } - } else if (operation.returnType.startsWith("Set")) { - String rt = operation.returnType; - int end = rt.lastIndexOf(">"); - if (end > 0) { - operation.returnType = rt.substring("Set<".length(), end).trim(); - operation.returnContainer = "Set"; - } - } - } - } - return objs; + return super.postProcessOperations(objs); } @Override diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/api.mustache index 20cd3c87db5..d4542532e29 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/api.mustache @@ -10,6 +10,7 @@ import io.swagger.jaxrs.*; {{#imports}}import {{import}}; {{/imports}} +import java.util.Map; import java.util.List; import {{package}}.NotFoundException; @@ -62,7 +63,7 @@ public class {{classname}} { {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} - @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, {{/hasMore}}{{/scopes}} @@ -70,7 +71,7 @@ public class {{classname}} { {{/hasMore}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) @io.swagger.annotations.ApiResponses(value = { {{#responses}} - @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}}, + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{#hasMore}}, {{/hasMore}}{{/responses}} }) public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}},{{/allParams}}@Context SecurityContext securityContext) throws NotFoundException { diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache index 63fdf2c8534..7c7e1c1ef3c 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache @@ -17,6 +17,7 @@ import java.io.InputStream; import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.apache.cxf.jaxrs.ext.multipart.Multipart; +import java.util.Map; import java.util.List; {{#useBeanValidation}} import javax.validation.constraints.*; @@ -42,7 +43,7 @@ public class {{classname}} { {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} - @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}@Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, {{/hasMore}}{{/scopes}} @@ -50,7 +51,7 @@ public class {{classname}} { {{/hasMore}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{#hasMore}}, {{/hasMore}}{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}},{{/hasMore}}{{/responses}} }) + @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{#hasMore}},{{/hasMore}}{{/responses}} }) public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { return delegate.{{nickname}}({{#allParams}}{{#isFile}}{{paramName}}InputStream, {{paramName}}Detail{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}, {{/allParams}}securityContext); } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache index bcaedef14b3..5e33aefc1d3 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache @@ -42,7 +42,7 @@ public interface {{classname}} { {{/hasProduces}} @ApiOperation(value = "{{{summary}}}", tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{#hasMore}}, {{/hasMore}}{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{{baseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{/vendorExtensions.x-java-is-response-void}}){{#hasMore}},{{/hasMore}}{{/responses}} }) + @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}{{/vendorExtensions.x-java-is-response-void}}){{#hasMore}},{{/hasMore}}{{/responses}} }) public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/operation}} } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache index 8e6066c8c84..6af86ffe4e4 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache @@ -1,4 +1,4 @@ {{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: }}{{^useGenericResponse}}{{! -}}{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{! +}}{{{returnType}}}{{! }}{{/useGenericResponse}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache index a3b9628f97b..386ebe68321 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache @@ -15,6 +15,7 @@ import javax.validation.constraints.*; {{#imports}}import {{import}}; {{/imports}} +import java.util.Map; import java.util.List; import {{package}}.NotFoundException; @@ -42,7 +43,7 @@ public class {{classname}} { {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} - @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, {{/hasMore}}{{/scopes}} @@ -50,7 +51,7 @@ public class {{classname}} { {{/hasMore}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{#hasMore}}, {{/hasMore}}{{/vendorExtensions.x-tags}} }) @io.swagger.annotations.ApiResponses(value = { {{#responses}} - @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}},{{/hasMore}}{{/responses}} }) + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{#hasMore}},{{/hasMore}}{{/responses}} }) public Response {{nickname}}( {{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}, {{/allParams}}@Context SecurityContext securityContext) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/api.mustache index 8bc376e5d2b..00740769465 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/api.mustache @@ -10,6 +10,7 @@ import io.swagger.jaxrs.*; {{#imports}}import {{import}}; {{/imports}} +import java.util.Map; import java.util.List; import {{package}}.NotFoundException; @@ -38,7 +39,7 @@ public class {{classname}} { {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} - @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, {{/hasMore}}{{/scopes}} @@ -46,7 +47,7 @@ public class {{classname}} { {{/hasMore}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) @io.swagger.annotations.ApiResponses(value = { {{#responses}} - @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}}, + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{#hasMore}}, {{/hasMore}}{{/responses}} }) public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{^isMultipart}}{{>formParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}@Context SecurityContext securityContext) throws NotFoundException { diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache index 733bf711a87..6a8bfba99fc 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache @@ -9,6 +9,7 @@ import io.swagger.jaxrs.*; {{/imports}} import java.util.List; +import java.util.Map; import java.io.InputStream; @@ -34,7 +35,7 @@ public interface {{classname}} { {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} - @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, {{/hasMore}}{{/scopes}} @@ -42,7 +43,7 @@ public interface {{classname}} { {{/hasMore}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) @io.swagger.annotations.ApiResponses(value = { {{#responses}} - @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}}, + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{#hasMore}}, {{/hasMore}}{{/responses}} }) public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{^isMultipart}}{{>formParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}@Context SecurityContext securityContext); {{/operation}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/api.mustache index 5b8f44ca3e9..d552ebdeae5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/api.mustache @@ -8,6 +8,7 @@ import javax.ws.rs.core.Response; import io.swagger.annotations.*; +import java.util.Map; import java.util.List; {{#useBeanValidation}} import javax.validation.constraints.*; @@ -28,7 +29,7 @@ public class {{classname}} { {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} - @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}@Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, {{/hasMore}}{{/scopes}} @@ -36,7 +37,7 @@ public class {{classname}} { {{/hasMore}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{#hasMore}}, {{/hasMore}}{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}},{{/hasMore}}{{/responses}} }) + @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{#hasMore}},{{/hasMore}}{{/responses}} }) public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}) { return Response.ok().entity("magic!").build(); } diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Order.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Order.java index a5bdf93b6f3..5b4a67f50c1 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Order.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Order.java @@ -151,7 +151,7 @@ public Order status(StatusEnum status) { * Get complete * @return complete **/ - public Boolean getComplete() { + public Boolean isComplete() { return complete; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java index a5bdf93b6f3..5b4a67f50c1 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java @@ -151,7 +151,7 @@ public Order status(StatusEnum status) { * Get complete * @return complete **/ - public Boolean getComplete() { + public Boolean isComplete() { return complete; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApi.java index 5e1c8a5eee7..791ba8bbd1b 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApi.java @@ -18,6 +18,7 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.apache.cxf.jaxrs.ext.multipart.Multipart; +import java.util.Map; import java.util.List; import javax.validation.constraints.*; @Path("/pet") @@ -39,14 +40,14 @@ public class PetApi { @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Add a new pet to the store", notes = "", response = void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { return delegate.addPet(body, securityContext); } @@ -55,14 +56,14 @@ public Response addPet(@ApiParam(value = "Pet object that needs to be added to t @Path("/{petId}") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Deletes a pet", notes = "", response = void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid pet value", response = void.class) }) + @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId, @ApiParam(value = "" )@HeaderParam("api_key") String apiKey) { return delegate.deletePet(petId, apiKey, securityContext); } @@ -79,7 +80,7 @@ public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @P }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + @ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) public Response findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="available, pending, sold") @QueryParam("status") List status) { return delegate.findPetsByStatus(status, securityContext); } @@ -96,7 +97,7 @@ public Response findPetsByStatus( @NotNull @ApiParam(value = "Status values that }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags) { return delegate.findPetsByTags(tags, securityContext); } @@ -110,8 +111,8 @@ public Response findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by",r }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), - @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId) { return delegate.getPetById(petId, securityContext); } @@ -120,16 +121,16 @@ public Response getPetById(@ApiParam(value = "ID of pet to return",required=true @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Update an existing pet", notes = "", response = void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), - @ApiResponse(code = 404, message = "Pet not found", response = void.class), - @ApiResponse(code = 405, message = "Validation exception", response = void.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Pet not found", response = Void.class), + @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { return delegate.updatePet(body, securityContext); } @@ -138,14 +139,14 @@ public Response updatePet(@ApiParam(value = "Pet object that needs to be added t @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status) { return delegate.updatePetWithForm(petId, name, status, securityContext); } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApi.java index 8cf4d832171..f8bc97ba37d 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApi.java @@ -17,6 +17,7 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.apache.cxf.jaxrs.ext.multipart.Multipart; +import java.util.Map; import java.util.List; import javax.validation.constraints.*; @Path("/store") @@ -38,10 +39,10 @@ public class StoreApi { @Path("/order/{orderId}") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = void.class, tags={ "store", }) + @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), - @ApiResponse(code = 404, message = "Order not found", response = void.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("orderId") String orderId) { return delegate.deleteOrder(orderId, securityContext); } @@ -54,7 +55,7 @@ public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory() { return delegate.getInventory(securityContext); } @@ -66,8 +67,8 @@ public Response getInventory() { @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), - @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") Long orderId) { return delegate.getOrderById(orderId, securityContext); } @@ -79,7 +80,7 @@ public Response getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that n @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body) { return delegate.placeOrder(body, securityContext); } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApi.java index bfbae3dad70..ff25df94fe7 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApi.java @@ -17,6 +17,7 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.apache.cxf.jaxrs.ext.multipart.Multipart; +import java.util.Map; import java.util.List; import javax.validation.constraints.*; @Path("/user") @@ -38,9 +39,9 @@ public class UserApi { @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) + @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body) { return delegate.createUser(body, securityContext); } @@ -49,9 +50,9 @@ public Response createUser(@ApiParam(value = "Created user object" ,required=tru @Path("/createWithArray") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body) { return delegate.createUsersWithArrayInput(body, securityContext); } @@ -60,9 +61,9 @@ public Response createUsersWithArrayInput(@ApiParam(value = "List of user object @Path("/createWithList") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body) { return delegate.createUsersWithListInput(body, securityContext); } @@ -71,10 +72,10 @@ public Response createUsersWithListInput(@ApiParam(value = "List of user object" @Path("/{username}") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied", response = void.class), - @ApiResponse(code = 404, message = "User not found", response = void.class) }) + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathParam("username") String username) { return delegate.deleteUser(username, securityContext); } @@ -86,8 +87,8 @@ public Response deleteUser(@ApiParam(value = "The name that needs to be deleted" @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), - @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true) @PathParam("username") String username) { return delegate.getUserByName(username, securityContext); } @@ -99,7 +100,7 @@ public Response getUserByName(@ApiParam(value = "The name that needs to be fetch @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) public Response loginUser( @NotNull @ApiParam(value = "The user name for login",required=true) @QueryParam("username") String username, @NotNull @ApiParam(value = "The password for login in clear text",required=true) @QueryParam("password") String password) { return delegate.loginUser(username, password, securityContext); } @@ -108,9 +109,9 @@ public Response loginUser( @NotNull @ApiParam(value = "The user name for login", @Path("/logout") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Logs out current logged in user session", notes = "", response = void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response logoutUser() { return delegate.logoutUser(securityContext); } @@ -119,10 +120,10 @@ public Response logoutUser() { @Path("/{username}") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user" }) + @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied", response = void.class), - @ApiResponse(code = 404, message = "User not found", response = void.class) }) + @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username, @ApiParam(value = "Updated user object" ,required=true) User body) { return delegate.updateUser(username, body, securityContext); } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json index 604bfd0a6b5..a16c8a8a14d 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json +++ b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json @@ -108,8 +108,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] + "enum" : [ "available", "pending", "sold" ], + "default" : "available" }, "collectionFormat" : "csv" } ], diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java index a5bdf93b6f3..5b4a67f50c1 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java @@ -151,7 +151,7 @@ public Order status(StatusEnum status) { * Get complete * @return complete **/ - public Boolean getComplete() { + public Boolean isComplete() { return complete; } diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApi.java index 7586f8cfed8..90e60b780a9 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApi.java @@ -11,6 +11,7 @@ import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -76,7 +77,7 @@ public Response deletePet( @PathParam("petId") Long petId,@ApiParam(value = "" ) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) public Response findPetsByStatus( @NotNull @QueryParam("status") List status,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status,securityContext); @@ -94,7 +95,7 @@ public Response findPetsByStatus( @NotNull @QueryParam("status") List s @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags( @NotNull @QueryParam("tags") List tags,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags,securityContext); @@ -109,9 +110,9 @@ public Response findPetsByTags( @NotNull @QueryParam("tags") List tags, @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getPetById(petId,securityContext); diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApi.java index f8ef1c59ade..c2479535d75 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApi.java @@ -10,6 +10,7 @@ import java.util.Map; import io.swagger.model.Order; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -50,7 +51,7 @@ public Response deleteOrder( @PathParam("orderId") String orderId,@Context Secur @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { return delegate.getInventory(securityContext); @@ -63,9 +64,9 @@ public Response getInventory(@Context SecurityContext securityContext) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getOrderById(orderId,securityContext); @@ -78,7 +79,7 @@ public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.placeOrder(body,securityContext); diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApi.java index 5790caaa4b2..d54375e6c78 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApi.java @@ -10,6 +10,7 @@ import java.util.List; import io.swagger.model.User; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -83,9 +84,9 @@ public Response deleteUser( @PathParam("username") String username,@Context Secu @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getUserByName(username,securityContext); @@ -98,7 +99,7 @@ public Response getUserByName( @PathParam("username") String username,@Context S @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) public Response loginUser( @NotNull @QueryParam("username") String username, @NotNull @QueryParam("password") String password,@Context SecurityContext securityContext) throws NotFoundException { return delegate.loginUser(username,password,securityContext); diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java index 4ac001b7e98..2f62263c9d3 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java @@ -110,7 +110,7 @@ public void setStatus(StatusEnum status) { @ApiModelProperty(value = "") @JsonProperty("complete") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } public void setComplete(Boolean complete) { diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/PetApi.java index 41596b5dfad..fafe4a5b85c 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/PetApi.java @@ -10,6 +10,7 @@ import io.swagger.model.Pet; import java.util.List; +import java.util.Map; import java.io.InputStream; @@ -66,7 +67,7 @@ public interface PetApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) public Response findPetsByStatus( @NotNull @QueryParam("status") List status,@Context SecurityContext securityContext); @GET @Path("/findByTags") @@ -81,7 +82,7 @@ public interface PetApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags( @NotNull @QueryParam("tags") List tags,@Context SecurityContext securityContext); @GET @Path("/{petId}") @@ -93,9 +94,9 @@ public interface PetApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext); @PUT diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/StoreApi.java index 2d23dba5649..133e801e900 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/StoreApi.java @@ -9,6 +9,7 @@ import io.swagger.model.Order; import java.util.List; +import java.util.Map; import java.io.InputStream; @@ -43,7 +44,7 @@ public interface StoreApi { @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory(@Context SecurityContext securityContext); @GET @Path("/order/{orderId}") @@ -53,9 +54,9 @@ public interface StoreApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext); @POST @Path("/order") @@ -65,6 +66,6 @@ public interface StoreApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body,@Context SecurityContext securityContext); } diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/UserApi.java index 88944c1940e..384aac51777 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/UserApi.java @@ -9,6 +9,7 @@ import io.swagger.model.User; import java.util.List; +import java.util.Map; import java.io.InputStream; @@ -67,9 +68,9 @@ public interface UserApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext); @GET @Path("/login") @@ -79,7 +80,7 @@ public interface UserApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) public Response loginUser( @NotNull @QueryParam("username") String username, @NotNull @QueryParam("password") String password,@Context SecurityContext securityContext); @GET @Path("/logout") diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Order.java index a2ed0d84895..3b7151b390e 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Order.java @@ -110,7 +110,7 @@ public void setStatus(StatusEnum status) { @ApiModelProperty(value = "") @JsonProperty("complete") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } public void setComplete(Boolean complete) { diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/PetApi.java index 41596b5dfad..fafe4a5b85c 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/PetApi.java @@ -10,6 +10,7 @@ import io.swagger.model.Pet; import java.util.List; +import java.util.Map; import java.io.InputStream; @@ -66,7 +67,7 @@ public interface PetApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) public Response findPetsByStatus( @NotNull @QueryParam("status") List status,@Context SecurityContext securityContext); @GET @Path("/findByTags") @@ -81,7 +82,7 @@ public interface PetApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags( @NotNull @QueryParam("tags") List tags,@Context SecurityContext securityContext); @GET @Path("/{petId}") @@ -93,9 +94,9 @@ public interface PetApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext); @PUT diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/StoreApi.java index 2d23dba5649..133e801e900 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/StoreApi.java @@ -9,6 +9,7 @@ import io.swagger.model.Order; import java.util.List; +import java.util.Map; import java.io.InputStream; @@ -43,7 +44,7 @@ public interface StoreApi { @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory(@Context SecurityContext securityContext); @GET @Path("/order/{orderId}") @@ -53,9 +54,9 @@ public interface StoreApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext); @POST @Path("/order") @@ -65,6 +66,6 @@ public interface StoreApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body,@Context SecurityContext securityContext); } diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/UserApi.java index 88944c1940e..384aac51777 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/UserApi.java @@ -9,6 +9,7 @@ import io.swagger.model.User; import java.util.List; +import java.util.Map; import java.io.InputStream; @@ -67,9 +68,9 @@ public interface UserApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext); @GET @Path("/login") @@ -79,7 +80,7 @@ public interface UserApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) public Response loginUser( @NotNull @QueryParam("username") String username, @NotNull @QueryParam("password") String password,@Context SecurityContext securityContext); @GET @Path("/logout") diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Order.java index 6cefdc7953e..7e5b9613d76 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Order.java @@ -110,7 +110,7 @@ public void setStatus(StatusEnum status) { @ApiModelProperty(value = "") @JsonProperty("complete") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } public void setComplete(Boolean complete) { diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/PetApi.java index 41596b5dfad..fafe4a5b85c 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/PetApi.java @@ -10,6 +10,7 @@ import io.swagger.model.Pet; import java.util.List; +import java.util.Map; import java.io.InputStream; @@ -66,7 +67,7 @@ public interface PetApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) public Response findPetsByStatus( @NotNull @QueryParam("status") List status,@Context SecurityContext securityContext); @GET @Path("/findByTags") @@ -81,7 +82,7 @@ public interface PetApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags( @NotNull @QueryParam("tags") List tags,@Context SecurityContext securityContext); @GET @Path("/{petId}") @@ -93,9 +94,9 @@ public interface PetApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext); @PUT diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/StoreApi.java index 2d23dba5649..133e801e900 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/StoreApi.java @@ -9,6 +9,7 @@ import io.swagger.model.Order; import java.util.List; +import java.util.Map; import java.io.InputStream; @@ -43,7 +44,7 @@ public interface StoreApi { @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory(@Context SecurityContext securityContext); @GET @Path("/order/{orderId}") @@ -53,9 +54,9 @@ public interface StoreApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext); @POST @Path("/order") @@ -65,6 +66,6 @@ public interface StoreApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body,@Context SecurityContext securityContext); } diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/UserApi.java index 88944c1940e..384aac51777 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/UserApi.java @@ -9,6 +9,7 @@ import io.swagger.model.User; import java.util.List; +import java.util.Map; import java.io.InputStream; @@ -67,9 +68,9 @@ public interface UserApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext); @GET @Path("/login") @@ -79,7 +80,7 @@ public interface UserApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) public Response loginUser( @NotNull @QueryParam("username") String username, @NotNull @QueryParam("password") String password,@Context SecurityContext securityContext); @GET @Path("/logout") diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Order.java index 033a4cdcca3..a88a6ca70f6 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Order.java @@ -110,7 +110,7 @@ public void setStatus(StatusEnum status) { @ApiModelProperty(value = "") @JsonProperty("complete") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } public void setComplete(Boolean complete) { diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/PetApi.java index 7586f8cfed8..90e60b780a9 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/PetApi.java @@ -11,6 +11,7 @@ import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -76,7 +77,7 @@ public Response deletePet( @PathParam("petId") Long petId,@ApiParam(value = "" ) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) public Response findPetsByStatus( @NotNull @QueryParam("status") List status,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status,securityContext); @@ -94,7 +95,7 @@ public Response findPetsByStatus( @NotNull @QueryParam("status") List s @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags( @NotNull @QueryParam("tags") List tags,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags,securityContext); @@ -109,9 +110,9 @@ public Response findPetsByTags( @NotNull @QueryParam("tags") List tags, @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getPetById(petId,securityContext); diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StoreApi.java index f8ef1c59ade..c2479535d75 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StoreApi.java @@ -10,6 +10,7 @@ import java.util.Map; import io.swagger.model.Order; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -50,7 +51,7 @@ public Response deleteOrder( @PathParam("orderId") String orderId,@Context Secur @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { return delegate.getInventory(securityContext); @@ -63,9 +64,9 @@ public Response getInventory(@Context SecurityContext securityContext) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getOrderById(orderId,securityContext); @@ -78,7 +79,7 @@ public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.placeOrder(body,securityContext); diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/UserApi.java index 5790caaa4b2..d54375e6c78 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/UserApi.java @@ -10,6 +10,7 @@ import java.util.List; import io.swagger.model.User; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -83,9 +84,9 @@ public Response deleteUser( @PathParam("username") String username,@Context Secu @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getUserByName(username,securityContext); @@ -98,7 +99,7 @@ public Response getUserByName( @PathParam("username") String username,@Context S @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) public Response loginUser( @NotNull @QueryParam("username") String username, @NotNull @QueryParam("password") String password,@Context SecurityContext securityContext) throws NotFoundException { return delegate.loginUser(username,password,securityContext); diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Order.java index 84237e713f9..cfdf85d655d 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Order.java @@ -110,7 +110,7 @@ public void setStatus(StatusEnum status) { @ApiModelProperty(value = "") @JsonProperty("complete") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } public void setComplete(Boolean complete) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java index 036292d5feb..f233b1f87be 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java @@ -11,6 +11,7 @@ import io.swagger.annotations.*; +import java.util.Map; import java.util.List; import javax.validation.constraints.*; @@ -82,12 +83,12 @@ public Response testClientModel(Client body) { @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied", response = void.class), - @ApiResponse(code = 404, message = "User not found", response = void.class) }) + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string,@FormParam(value = "binary") byte[] binary,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") Date dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) { return Response.ok().entity("magic!").build(); } @@ -96,10 +97,10 @@ public Response testEndpointParameters(@FormParam(value = "number") BigDecimal @Consumes({ "*/*" }) @Produces({ "*/*" }) - @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid request", response = void.class), - @ApiResponse(code = 404, message = "Not found", response = void.class) }) + @ApiResponse(code = 400, message = "Invalid request", response = Void.class), + @ApiResponse(code = 404, message = "Not found", response = Void.class) }) public Response testEnumParameters(@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString,@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@HeaderParam("enum_header_string") String enumHeaderString,@QueryParam("enum_query_string_array") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString,@QueryParam("enum_query_integer") Integer enumQueryInteger,@FormParam(value = "enum_query_double") Double enumQueryDouble) { return Response.ok().entity("magic!").build(); } @@ -108,9 +109,9 @@ public Response testEnumParameters(@FormParam(value = "enum_form_string_array") @Path("/jsonFormData") @Consumes({ "application/json" }) - @ApiOperation(value = "test json serialization of form data", notes = "", response = void.class, tags={ "fake" }) + @ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2) { return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeClassnameTestApi.java index 4041f6f5ec8..b9a438ede54 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeClassnameTestApi.java @@ -7,6 +7,7 @@ import io.swagger.annotations.*; +import java.util.Map; import java.util.List; import javax.validation.constraints.*; @@ -23,7 +24,9 @@ public class FakeClassnameTestApi { @Consumes({ "application/json" }) @Produces({ "application/json" }) - @ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, tags={ "fake_classname_tags 123#$%^" }) + @ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { + @Authorization(value = "api_key_query") + }, tags={ "fake_classname_tags 123#$%^" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) public Response testClassname(Client body) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/PetApi.java index 08ea2b34380..6bca4c93b15 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/PetApi.java @@ -9,6 +9,7 @@ import io.swagger.annotations.*; +import java.util.Map; import java.util.List; import javax.validation.constraints.*; @@ -25,14 +26,14 @@ public class PetApi { @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Add a new pet to the store", notes = "", response = void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response addPet(Pet body) { return Response.ok().entity("magic!").build(); } @@ -41,14 +42,14 @@ public Response addPet(Pet body) { @Path("/{petId}") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Deletes a pet", notes = "", response = void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid pet value", response = void.class) }) + @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey) { return Response.ok().entity("magic!").build(); } @@ -65,7 +66,7 @@ public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + @ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) public Response findPetsByStatus(@QueryParam("status") @NotNull List status) { return Response.ok().entity("magic!").build(); } @@ -82,7 +83,7 @@ public Response findPetsByStatus(@QueryParam("status") @NotNull List st }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags(@QueryParam("tags") @NotNull List tags) { return Response.ok().entity("magic!").build(); } @@ -96,8 +97,8 @@ public Response findPetsByTags(@QueryParam("tags") @NotNull List tags) }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), - @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) public Response getPetById(@PathParam("petId") @ApiParam("ID of pet to return") Long petId) { return Response.ok().entity("magic!").build(); } @@ -106,16 +107,16 @@ public Response getPetById(@PathParam("petId") @ApiParam("ID of pet to return") @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Update an existing pet", notes = "", response = void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), - @ApiResponse(code = 404, message = "Pet not found", response = void.class), - @ApiResponse(code = 405, message = "Validation exception", response = void.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Pet not found", response = Void.class), + @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) public Response updatePet(Pet body) { return Response.ok().entity("magic!").build(); } @@ -124,14 +125,14 @@ public Response updatePet(Pet body) { @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) { return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java index 3d0a9532b51..ac6e743787f 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java @@ -8,6 +8,7 @@ import io.swagger.annotations.*; +import java.util.Map; import java.util.List; import javax.validation.constraints.*; @@ -24,10 +25,10 @@ public class StoreApi { @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = void.class, tags={ "store", }) + @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), - @ApiResponse(code = 404, message = "Order not found", response = void.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") String orderId) { return Response.ok().entity("magic!").build(); } @@ -40,7 +41,7 @@ public Response deleteOrder(@PathParam("order_id") @ApiParam("ID of the order th @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory() { return Response.ok().entity("magic!").build(); } @@ -52,8 +53,8 @@ public Response getInventory() { @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), - @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response getOrderById(@PathParam("order_id") @Min(1) @Max(5) @ApiParam("ID of pet that needs to be fetched") Long orderId) { return Response.ok().entity("magic!").build(); } @@ -65,7 +66,7 @@ public Response getOrderById(@PathParam("order_id") @Min(1) @Max(5) @ApiParam("I @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) public Response placeOrder(Order body) { return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/UserApi.java index bae63cd9903..43bc61a37e9 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/UserApi.java @@ -8,6 +8,7 @@ import io.swagger.annotations.*; +import java.util.Map; import java.util.List; import javax.validation.constraints.*; @@ -24,9 +25,9 @@ public class UserApi { @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) + @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUser(User body) { return Response.ok().entity("magic!").build(); } @@ -35,9 +36,9 @@ public Response createUser(User body) { @Path("/createWithArray") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithArrayInput(List body) { return Response.ok().entity("magic!").build(); } @@ -46,9 +47,9 @@ public Response createUsersWithArrayInput(List body) { @Path("/createWithList") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithListInput(List body) { return Response.ok().entity("magic!").build(); } @@ -57,10 +58,10 @@ public Response createUsersWithListInput(List body) { @Path("/{username}") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied", response = void.class), - @ApiResponse(code = 404, message = "User not found", response = void.class) }) + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response deleteUser(@PathParam("username") @ApiParam("The name that needs to be deleted") String username) { return Response.ok().entity("magic!").build(); } @@ -72,8 +73,8 @@ public Response deleteUser(@PathParam("username") @ApiParam("The name that needs @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), - @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response getUserByName(@PathParam("username") @ApiParam("The name that needs to be fetched. Use user1 for testing. ") String username) { return Response.ok().entity("magic!").build(); } @@ -85,7 +86,7 @@ public Response getUserByName(@PathParam("username") @ApiParam("The name that ne @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) public Response loginUser(@QueryParam("username") @NotNull String username,@QueryParam("password") @NotNull String password) { return Response.ok().entity("magic!").build(); } @@ -94,9 +95,9 @@ public Response loginUser(@QueryParam("username") @NotNull String username,@Que @Path("/logout") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Logs out current logged in user session", notes = "", response = void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response logoutUser() { return Response.ok().entity("magic!").build(); } @@ -105,10 +106,10 @@ public Response logoutUser() { @Path("/{username}") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user" }) + @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied", response = void.class), - @ApiResponse(code = 404, message = "User not found", response = void.class) }) + @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,User body) { return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java index e9aeb143274..052a0b3b31d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java @@ -21,7 +21,7 @@ public Cat declawed(Boolean declawed) { @ApiModelProperty(value = "") - public Boolean getDeclawed() { + public Boolean isDeclawed() { return declawed; } public void setDeclawed(Boolean declawed) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java index 25c8a9e7bed..ca0f9021c3f 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java @@ -138,7 +138,7 @@ public Order complete(Boolean complete) { @ApiModelProperty(value = "") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } public void setComplete(Boolean complete) { diff --git a/samples/server/petstore/jaxrs-spec/swagger.json b/samples/server/petstore/jaxrs-spec/swagger.json index bcdb5fc36c6..d33017f379f 100644 --- a/samples/server/petstore/jaxrs-spec/swagger.json +++ b/samples/server/petstore/jaxrs-spec/swagger.json @@ -108,8 +108,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] + "enum" : [ "available", "pending", "sold" ], + "default" : "available" }, "collectionFormat" : "csv" } ], @@ -166,7 +166,8 @@ }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] - } ] + } ], + "deprecated" : true } }, "/pet/{petId}" : { @@ -657,7 +658,10 @@ "$ref" : "#/definitions/Client" } } - } + }, + "security" : [ { + "api_key_query" : [ ] + } ] } }, "/fake" : { @@ -676,8 +680,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_form_string", @@ -695,8 +699,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_header_string", @@ -714,8 +718,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_query_string", @@ -1042,6 +1046,11 @@ "name" : "api_key", "in" : "header" }, + "api_key_query" : { + "type" : "apiKey", + "name" : "api_key_query", + "in" : "query" + }, "http_basic_test" : { "type" : "basic" } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeApi.java index bb401a709da..a04f054727e 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeApi.java @@ -15,6 +15,7 @@ import java.util.Date; import io.swagger.model.OuterComposite; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -28,16 +29,16 @@ import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; -@Path("/fake") +@Path("/Fake") -@io.swagger.annotations.Api(description = "the fake API") +@io.swagger.annotations.Api(description = "the Fake API") public class FakeApi { private final FakeApiService delegate = FakeApiServiceFactory.getFakeApi(); @POST - @Path("/outer/boolean") + @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @@ -50,7 +51,7 @@ public Response fakeOuterBooleanSerialize( return delegate.fakeOuterBooleanSerialize(body,securityContext); } @POST - @Path("/outer/composite") + @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @@ -63,7 +64,7 @@ public Response fakeOuterCompositeSerialize( return delegate.fakeOuterCompositeSerialize(body,securityContext); } @POST - @Path("/outer/number") + @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @@ -76,7 +77,7 @@ public Response fakeOuterNumberSerialize( return delegate.fakeOuterNumberSerialize(body,securityContext); } @POST - @Path("/outer/string") + @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @@ -105,12 +106,12 @@ public Response testClientModel( @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "http_basic_test") }, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response testEndpointParameters( @ApiParam(value = "None", required=true) @FormParam("number") BigDecimal number, @ApiParam(value = "None", required=true) @FormParam("double") Double _double, @@ -134,10 +135,10 @@ public Response testEndpointParameters( @Consumes({ "*/*" }) @Produces({ "*/*" }) - @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = void.class, tags={ "fake", }) + @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) }) public Response testEnumParameters( @ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @FormParam("enum_form_string_array") List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString, @@ -152,12 +153,12 @@ public Response testEnumParameters( return delegate.testEnumParameters(enumFormStringArray,enumFormString,enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,enumQueryDouble,securityContext); } @GET - @Path("/jsonFormData") + @Consumes({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = void.class, tags={ "fake" }) + @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response testJsonFormData( @ApiParam(value = "field1", required=true) @FormParam("param") String param, @ApiParam(value = "field2", required=true) @FormParam("param2") String param2, diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java similarity index 76% rename from samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTestApi.java rename to samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java index aca0a5f0d5a..b406c5cb0cd 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java @@ -1,8 +1,8 @@ package io.swagger.api; import io.swagger.model.*; -import io.swagger.api.FakeClassnameTestApiService; -import io.swagger.api.factories.FakeClassnameTestApiServiceFactory; +import io.swagger.api.FakeClassnameTags123ApiService; +import io.swagger.api.factories.FakeClassnameTags123ApiServiceFactory; import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; @@ -12,6 +12,7 @@ import io.swagger.model.Client; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -25,13 +26,13 @@ import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; -@Path("/fake_classname_test") +@Path("/FakeClassnameTags123") -@io.swagger.annotations.Api(description = "the fake_classname_test API") +@io.swagger.annotations.Api(description = "the FakeClassnameTags123 API") -public class FakeClassnameTestApi { - private final FakeClassnameTestApiService delegate = FakeClassnameTestApiServiceFactory.getFakeClassnameTestApi(); +public class FakeClassnameTags123Api { + private final FakeClassnameTags123ApiService delegate = FakeClassnameTags123ApiServiceFactory.getFakeClassnameTags123Api(); @PATCH diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTestApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java similarity index 91% rename from samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTestApiService.java rename to samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java index 7dd1c6de0e4..ecf374c3758 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTestApiService.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java @@ -19,7 +19,7 @@ import javax.ws.rs.core.SecurityContext; import javax.validation.constraints.*; -public abstract class FakeClassnameTestApiService { +public abstract class FakeClassnameTags123ApiService { public abstract Response testClassname(Client body,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/PetApi.java index c7387bd20d7..d1187719cd4 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/PetApi.java @@ -14,6 +14,7 @@ import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -27,10 +28,10 @@ import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; -@Path("/pet") +@Path("/Pet") -@io.swagger.annotations.Api(description = "the pet API") +@io.swagger.annotations.Api(description = "the Pet API") public class PetApi { private final PetApiService delegate = PetApiServiceFactory.getPetApi(); @@ -39,14 +40,14 @@ public class PetApi { @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response addPet( @ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body, @Context SecurityContext securityContext) @@ -54,17 +55,17 @@ public Response addPet( return delegate.addPet(body,securityContext); } @DELETE - @Path("/{petId}") + @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet( @ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId, @ApiParam(value = "" )@HeaderParam("api_key") String apiKey, @@ -73,7 +74,7 @@ public Response deletePet( return delegate.deletePet(petId,apiKey,securityContext); } @GET - @Path("/findByStatus") + @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @@ -84,7 +85,7 @@ public Response deletePet( }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) public Response findPetsByStatus( @ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="available, pending, sold") @QueryParam("status") List status, @Context SecurityContext securityContext) @@ -92,7 +93,7 @@ public Response findPetsByStatus( return delegate.findPetsByStatus(status,securityContext); } @GET - @Path("/findByTags") + @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @@ -103,7 +104,7 @@ public Response findPetsByStatus( }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags( @ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags, @Context SecurityContext securityContext) @@ -111,7 +112,7 @@ public Response findPetsByTags( return delegate.findPetsByTags(tags,securityContext); } @GET - @Path("/{petId}") + @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { @@ -119,8 +120,8 @@ public Response findPetsByTags( }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) public Response getPetById( @ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId, @Context SecurityContext securityContext) @@ -131,16 +132,16 @@ public Response getPetById( @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = void.class), - @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) public Response updatePet( @ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body, @Context SecurityContext securityContext) @@ -148,17 +149,17 @@ public Response updatePet( return delegate.updatePet(body,securityContext); } @POST - @Path("/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") Long petId, @ApiParam(value = "Updated name of the pet") @FormParam("name") String name, @@ -168,7 +169,7 @@ public Response updatePetWithForm( return delegate.updatePetWithForm(petId,name,status,securityContext); } @POST - @Path("/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/StoreApi.java index 27e16621905..314a34eb401 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/StoreApi.java @@ -13,6 +13,7 @@ import java.util.Map; import io.swagger.model.Order; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -26,22 +27,22 @@ import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; -@Path("/store") +@Path("/Store") -@io.swagger.annotations.Api(description = "the store API") +@io.swagger.annotations.Api(description = "the Store API") public class StoreApi { private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi(); @DELETE - @Path("/order/{order_id}") + @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = void.class, tags={ "store", }) + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("order_id") String orderId, @Context SecurityContext securityContext) @@ -49,28 +50,28 @@ public Response deleteOrder( return delegate.deleteOrder(orderId,securityContext); } @GET - @Path("/inventory") + @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory( @Context SecurityContext securityContext) throws NotFoundException { return delegate.getInventory(securityContext); } @GET - @Path("/order/{order_id}") + @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response getOrderById( @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("order_id") Long orderId, @Context SecurityContext securityContext) @@ -78,13 +79,13 @@ public Response getOrderById( return delegate.getOrderById(orderId,securityContext); } @POST - @Path("/order") + @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) public Response placeOrder( @ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body, @Context SecurityContext securityContext) diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/UserApi.java index f6b03fd77c1..20d675ebdeb 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/UserApi.java @@ -13,6 +13,7 @@ import java.util.List; import io.swagger.model.User; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -26,10 +27,10 @@ import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; -@Path("/user") +@Path("/User") -@io.swagger.annotations.Api(description = "the user API") +@io.swagger.annotations.Api(description = "the User API") public class UserApi { private final UserApiService delegate = UserApiServiceFactory.getUserApi(); @@ -38,9 +39,9 @@ public class UserApi { @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUser( @ApiParam(value = "Created user object" ,required=true) User body, @Context SecurityContext securityContext) @@ -48,12 +49,12 @@ public Response createUser( return delegate.createUser(body,securityContext); } @POST - @Path("/createWithArray") + @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithArrayInput( @ApiParam(value = "List of user object" ,required=true) List body, @Context SecurityContext securityContext) @@ -61,12 +62,12 @@ public Response createUsersWithArrayInput( return delegate.createUsersWithArrayInput(body,securityContext); } @POST - @Path("/createWithList") + @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithListInput( @ApiParam(value = "List of user object" ,required=true) List body, @Context SecurityContext securityContext) @@ -74,13 +75,13 @@ public Response createUsersWithListInput( return delegate.createUsersWithListInput(body,securityContext); } @DELETE - @Path("/{username}") + @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response deleteUser( @ApiParam(value = "The name that needs to be deleted",required=true) @PathParam("username") String username, @Context SecurityContext securityContext) @@ -88,14 +89,14 @@ public Response deleteUser( return delegate.deleteUser(username,securityContext); } @GET - @Path("/{username}") + @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true) @PathParam("username") String username, @Context SecurityContext securityContext) @@ -103,13 +104,13 @@ public Response getUserByName( return delegate.getUserByName(username,securityContext); } @GET - @Path("/login") + @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) public Response loginUser( @ApiParam(value = "The user name for login",required=true) @QueryParam("username") String username, @ApiParam(value = "The password for login in clear text",required=true) @QueryParam("password") String password, @@ -118,25 +119,25 @@ public Response loginUser( return delegate.loginUser(username,password,securityContext); } @GET - @Path("/logout") + @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response logoutUser( @Context SecurityContext securityContext) throws NotFoundException { return delegate.logoutUser(securityContext); } @PUT - @Path("/{username}") + @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user" }) + @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response updateUser( @ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username, @ApiParam(value = "Updated user object" ,required=true) User body, diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/factories/FakeClassnameTags123ApiServiceFactory.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/factories/FakeClassnameTags123ApiServiceFactory.java new file mode 100644 index 00000000000..b4241437236 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/factories/FakeClassnameTags123ApiServiceFactory.java @@ -0,0 +1,13 @@ +package io.swagger.api.factories; + +import io.swagger.api.FakeClassnameTags123ApiService; +import io.swagger.api.impl.FakeClassnameTags123ApiServiceImpl; + + +public class FakeClassnameTags123ApiServiceFactory { + private final static FakeClassnameTags123ApiService service = new FakeClassnameTags123ApiServiceImpl(); + + public static FakeClassnameTags123ApiService getFakeClassnameTags123Api() { + return service; + } +} diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/factories/FakeClassnameTestApiServiceFactory.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/factories/FakeClassnameTestApiServiceFactory.java deleted file mode 100644 index dc123113010..00000000000 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/factories/FakeClassnameTestApiServiceFactory.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.swagger.api.factories; - -import io.swagger.api.FakeClassnameTestApiService; -import io.swagger.api.impl.FakeClassnameTestApiServiceImpl; - - -public class FakeClassnameTestApiServiceFactory { - private final static FakeClassnameTestApiService service = new FakeClassnameTestApiServiceImpl(); - - public static FakeClassnameTestApiService getFakeClassnameTestApi() { - return service; - } -} diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTestApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java similarity index 89% rename from samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTestApiServiceImpl.java rename to samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java index 071dbe62e15..5b44353efec 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTestApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java @@ -19,7 +19,7 @@ import javax.ws.rs.core.SecurityContext; import javax.validation.constraints.*; -public class FakeClassnameTestApiServiceImpl extends FakeClassnameTestApiService { +public class FakeClassnameTags123ApiServiceImpl extends FakeClassnameTags123ApiService { @Override public Response testClassname(Client body, SecurityContext securityContext) throws NotFoundException { diff --git a/samples/server/petstore/jaxrs/jersey1/README.md b/samples/server/petstore/jaxrs/jersey1/README.md index cc011c37ee5..faa1cc0c2b7 100644 --- a/samples/server/petstore/jaxrs/jersey1/README.md +++ b/samples/server/petstore/jaxrs/jersey1/README.md @@ -1,4 +1,4 @@ -# Swagger generated server +# Swagger Jersey generated server ## Overview This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeApi.java index bb401a709da..2bbe7e14467 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeApi.java @@ -15,6 +15,7 @@ import java.util.Date; import io.swagger.model.OuterComposite; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -105,12 +106,12 @@ public Response testClientModel( @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "http_basic_test") }, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response testEndpointParameters( @ApiParam(value = "None", required=true) @FormParam("number") BigDecimal number, @ApiParam(value = "None", required=true) @FormParam("double") Double _double, @@ -134,10 +135,10 @@ public Response testEndpointParameters( @Consumes({ "*/*" }) @Produces({ "*/*" }) - @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = void.class, tags={ "fake", }) + @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) }) public Response testEnumParameters( @ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @FormParam("enum_form_string_array") List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString, @@ -155,9 +156,9 @@ public Response testEnumParameters( @Path("/jsonFormData") @Consumes({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = void.class, tags={ "fake" }) + @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response testJsonFormData( @ApiParam(value = "field1", required=true) @FormParam("param") String param, @ApiParam(value = "field2", required=true) @FormParam("param2") String param2, diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeClassnameTestApi.java index aca0a5f0d5a..7a0e5315338 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeClassnameTestApi.java @@ -12,6 +12,7 @@ import io.swagger.model.Client; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/PetApi.java index c7387bd20d7..0bd48fed494 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/PetApi.java @@ -14,6 +14,7 @@ import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -39,14 +40,14 @@ public class PetApi { @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response addPet( @ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body, @Context SecurityContext securityContext) @@ -57,14 +58,14 @@ public Response addPet( @Path("/{petId}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet( @ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId, @ApiParam(value = "" )@HeaderParam("api_key") String apiKey, @@ -84,7 +85,7 @@ public Response deletePet( }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) public Response findPetsByStatus( @ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="available, pending, sold") @QueryParam("status") List status, @Context SecurityContext securityContext) @@ -103,7 +104,7 @@ public Response findPetsByStatus( }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags( @ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags, @Context SecurityContext securityContext) @@ -119,8 +120,8 @@ public Response findPetsByTags( }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) public Response getPetById( @ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId, @Context SecurityContext securityContext) @@ -131,16 +132,16 @@ public Response getPetById( @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = void.class), - @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) public Response updatePet( @ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body, @Context SecurityContext securityContext) @@ -151,14 +152,14 @@ public Response updatePet( @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") Long petId, @ApiParam(value = "Updated name of the pet") @FormParam("name") String name, diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/StoreApi.java index 27e16621905..693228ad890 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/StoreApi.java @@ -13,6 +13,7 @@ import java.util.Map; import io.swagger.model.Order; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -38,10 +39,10 @@ public class StoreApi { @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = void.class, tags={ "store", }) + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("order_id") String orderId, @Context SecurityContext securityContext) @@ -56,7 +57,7 @@ public Response deleteOrder( @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory( @Context SecurityContext securityContext) throws NotFoundException { @@ -69,8 +70,8 @@ public Response getInventory( @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response getOrderById( @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("order_id") Long orderId, @Context SecurityContext securityContext) @@ -84,7 +85,7 @@ public Response getOrderById( @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) public Response placeOrder( @ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body, @Context SecurityContext securityContext) diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/UserApi.java index f6b03fd77c1..11ce07af10f 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/UserApi.java @@ -13,6 +13,7 @@ import java.util.List; import io.swagger.model.User; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -38,9 +39,9 @@ public class UserApi { @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUser( @ApiParam(value = "Created user object" ,required=true) User body, @Context SecurityContext securityContext) @@ -51,9 +52,9 @@ public Response createUser( @Path("/createWithArray") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithArrayInput( @ApiParam(value = "List of user object" ,required=true) List body, @Context SecurityContext securityContext) @@ -64,9 +65,9 @@ public Response createUsersWithArrayInput( @Path("/createWithList") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithListInput( @ApiParam(value = "List of user object" ,required=true) List body, @Context SecurityContext securityContext) @@ -77,10 +78,10 @@ public Response createUsersWithListInput( @Path("/{username}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response deleteUser( @ApiParam(value = "The name that needs to be deleted",required=true) @PathParam("username") String username, @Context SecurityContext securityContext) @@ -94,8 +95,8 @@ public Response deleteUser( @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true) @PathParam("username") String username, @Context SecurityContext securityContext) @@ -109,7 +110,7 @@ public Response getUserByName( @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) public Response loginUser( @ApiParam(value = "The user name for login",required=true) @QueryParam("username") String username, @ApiParam(value = "The password for login in clear text",required=true) @QueryParam("password") String password, @@ -121,9 +122,9 @@ public Response loginUser( @Path("/logout") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response logoutUser( @Context SecurityContext securityContext) throws NotFoundException { @@ -133,10 +134,10 @@ public Response logoutUser( @Path("/{username}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user" }) + @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response updateUser( @ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username, @ApiParam(value = "Updated user object" ,required=true) User body, diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeApi.java index 8935f8b3d79..06e1622f8b6 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeApi.java @@ -12,6 +12,7 @@ import java.util.Date; import io.swagger.model.OuterComposite; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -27,10 +28,10 @@ import javax.ws.rs.*; import javax.validation.constraints.*; -@Path("/fake") +@Path("/Fake") -@io.swagger.annotations.Api(description = "the fake API") +@io.swagger.annotations.Api(description = "the Fake API") public class FakeApi { private final FakeApiService delegate; @@ -57,7 +58,7 @@ public FakeApi(@Context ServletConfig servletContext) { } @POST - @Path("/outer/boolean") + @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @@ -69,7 +70,7 @@ public Response fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as po return delegate.fakeOuterBooleanSerialize(body,securityContext); } @POST - @Path("/outer/composite") + @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @@ -81,7 +82,7 @@ public Response fakeOuterCompositeSerialize(@ApiParam(value = "Input composite a return delegate.fakeOuterCompositeSerialize(body,securityContext); } @POST - @Path("/outer/number") + @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @@ -93,7 +94,7 @@ public Response fakeOuterNumberSerialize(@ApiParam(value = "Input number as post return delegate.fakeOuterNumberSerialize(body,securityContext); } @POST - @Path("/outer/string") + @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @@ -120,13 +121,13 @@ public Response testClientModel(@ApiParam(value = "client model" ,required=true) @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "http_basic_test") }, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response testEndpointParameters(@ApiParam(value = "None", required=true) @FormParam("number") BigDecimal number ,@ApiParam(value = "None", required=true) @FormParam("double") Double _double ,@ApiParam(value = "None", required=true) @FormParam("pattern_without_delimiter") String patternWithoutDelimiter @@ -149,11 +150,11 @@ public Response testEndpointParameters(@ApiParam(value = "None", required=true) @Consumes({ "*/*" }) @Produces({ "*/*" }) - @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = void.class, tags={ "fake", }) + @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) }) public Response testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @FormParam("enum_form_string_array") List enumFormStringArray ,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString ,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $")@HeaderParam("enum_header_string_array") List enumHeaderStringArray @@ -167,12 +168,12 @@ public Response testEnumParameters(@ApiParam(value = "Form parameter enum test ( return delegate.testEnumParameters(enumFormStringArray,enumFormString,enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,enumQueryDouble,securityContext); } @GET - @Path("/jsonFormData") + @Consumes({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = void.class, tags={ "fake", }) + @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response testJsonFormData(@ApiParam(value = "field1", required=true) @FormParam("param") String param ,@ApiParam(value = "field2", required=true) @FormParam("param2") String param2 ,@Context SecurityContext securityContext) diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java similarity index 71% rename from samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTestApi.java rename to samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java index 0985867b529..9a71d18cc0d 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java @@ -1,14 +1,15 @@ package io.swagger.api; import io.swagger.model.*; -import io.swagger.api.FakeClassnameTestApiService; -import io.swagger.api.factories.FakeClassnameTestApiServiceFactory; +import io.swagger.api.FakeClassnameTags123ApiService; +import io.swagger.api.factories.FakeClassnameTags123ApiServiceFactory; import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; import io.swagger.model.Client; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -24,22 +25,22 @@ import javax.ws.rs.*; import javax.validation.constraints.*; -@Path("/fake_classname_test") +@Path("/FakeClassnameTags123") -@io.swagger.annotations.Api(description = "the fake_classname_test API") +@io.swagger.annotations.Api(description = "the FakeClassnameTags123 API") -public class FakeClassnameTestApi { - private final FakeClassnameTestApiService delegate; +public class FakeClassnameTags123Api { + private final FakeClassnameTags123ApiService delegate; - public FakeClassnameTestApi(@Context ServletConfig servletContext) { - FakeClassnameTestApiService delegate = null; + public FakeClassnameTags123Api(@Context ServletConfig servletContext) { + FakeClassnameTags123ApiService delegate = null; if (servletContext != null) { - String implClass = servletContext.getInitParameter("FakeClassnameTestApi.implementation"); + String implClass = servletContext.getInitParameter("FakeClassnameTags123Api.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (FakeClassnameTestApiService) Class.forName(implClass).newInstance(); + delegate = (FakeClassnameTags123ApiService) Class.forName(implClass).newInstance(); } catch (Exception e) { throw new RuntimeException(e); } @@ -47,7 +48,7 @@ public FakeClassnameTestApi(@Context ServletConfig servletContext) { } if (delegate == null) { - delegate = FakeClassnameTestApiServiceFactory.getFakeClassnameTestApi(); + delegate = FakeClassnameTags123ApiServiceFactory.getFakeClassnameTags123Api(); } this.delegate = delegate; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTestApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java similarity index 90% rename from samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTestApiService.java rename to samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java index 9bf76fef9ef..65e819f60e2 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTestApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java @@ -16,6 +16,6 @@ import javax.ws.rs.core.SecurityContext; import javax.validation.constraints.*; -public abstract class FakeClassnameTestApiService { +public abstract class FakeClassnameTags123ApiService { public abstract Response testClassname(Client body,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/PetApi.java index 30b1eece3c8..5c84144601e 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/PetApi.java @@ -11,6 +11,7 @@ import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -26,10 +27,10 @@ import javax.ws.rs.*; import javax.validation.constraints.*; -@Path("/pet") +@Path("/Pet") -@io.swagger.annotations.Api(description = "the pet API") +@io.swagger.annotations.Api(description = "the Pet API") public class PetApi { private final PetApiService delegate; @@ -59,31 +60,31 @@ public PetApi(@Context ServletConfig servletContext) { @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.addPet(body,securityContext); } @DELETE - @Path("/{petId}") + @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId ,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey ,@Context SecurityContext securityContext) @@ -91,7 +92,7 @@ public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @P return delegate.deletePet(petId,apiKey,securityContext); } @GET - @Path("/findByStatus") + @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @@ -103,14 +104,14 @@ public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @P @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="available, pending, sold") @QueryParam("status") List status ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status,securityContext); } @GET - @Path("/findByTags") + @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @@ -122,14 +123,14 @@ public Response findPetsByStatus(@ApiParam(value = "Status values that need to b @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags(@ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags,securityContext); } @GET - @Path("/{petId}") + @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { @@ -138,9 +139,9 @@ public Response findPetsByTags(@ApiParam(value = "Tags to filter by",required=tr @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId ,@Context SecurityContext securityContext) throws NotFoundException { @@ -150,35 +151,35 @@ public Response getPetById(@ApiParam(value = "ID of pet to return",required=true @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.updatePet(body,securityContext); } @POST - @Path("/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") Long petId ,@ApiParam(value = "Updated name of the pet") @FormParam("name") String name ,@ApiParam(value = "Updated status of the pet") @FormParam("status") String status @@ -187,7 +188,7 @@ public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be return delegate.updatePetWithForm(petId,name,status,securityContext); } @POST - @Path("/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/StoreApi.java index 18c5a14979c..ff115214b86 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/StoreApi.java @@ -10,6 +10,7 @@ import java.util.Map; import io.swagger.model.Order; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -25,10 +26,10 @@ import javax.ws.rs.*; import javax.validation.constraints.*; -@Path("/store") +@Path("/Store") -@io.swagger.annotations.Api(description = "the store API") +@io.swagger.annotations.Api(description = "the Store API") public class StoreApi { private final StoreApiService delegate; @@ -55,57 +56,57 @@ public StoreApi(@Context ServletConfig servletContext) { } @DELETE - @Path("/order/{order_id}") + @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = void.class, tags={ "store", }) + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("order_id") String orderId ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.deleteOrder(orderId,securityContext); } @GET - @Path("/inventory") + @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { return delegate.getInventory(securityContext); } @GET - @Path("/order/{order_id}") + @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("order_id") Long orderId ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getOrderById(orderId,securityContext); } @POST - @Path("/order") + @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body ,@Context SecurityContext securityContext) throws NotFoundException { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/UserApi.java index 1a0225db3c2..371e6bb210c 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/UserApi.java @@ -10,6 +10,7 @@ import java.util.List; import io.swagger.model.User; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -25,10 +26,10 @@ import javax.ws.rs.*; import javax.validation.constraints.*; -@Path("/user") +@Path("/User") -@io.swagger.annotations.Api(description = "the user API") +@io.swagger.annotations.Api(description = "the User API") public class UserApi { private final UserApiService delegate; @@ -58,77 +59,77 @@ public UserApi(@Context ServletConfig servletContext) { @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createUser(body,securityContext); } @POST - @Path("/createWithArray") + @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createUsersWithArrayInput(body,securityContext); } @POST - @Path("/createWithList") + @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createUsersWithListInput(body,securityContext); } @DELETE - @Path("/{username}") + @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathParam("username") String username ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.deleteUser(username,securityContext); } @GET - @Path("/{username}") + @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true) @PathParam("username") String username ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getUserByName(username,securityContext); } @GET - @Path("/login") + @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) public Response loginUser(@ApiParam(value = "The user name for login",required=true) @QueryParam("username") String username ,@ApiParam(value = "The password for login in clear text",required=true) @QueryParam("password") String password ,@Context SecurityContext securityContext) @@ -136,25 +137,25 @@ public Response loginUser(@ApiParam(value = "The user name for login",required=t return delegate.loginUser(username,password,securityContext); } @GET - @Path("/logout") + @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response logoutUser(@Context SecurityContext securityContext) throws NotFoundException { return delegate.logoutUser(securityContext); } @PUT - @Path("/{username}") + @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username ,@ApiParam(value = "Updated user object" ,required=true) User body ,@Context SecurityContext securityContext) diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/factories/FakeClassnameTags123ApiServiceFactory.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/factories/FakeClassnameTags123ApiServiceFactory.java new file mode 100644 index 00000000000..b4241437236 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/factories/FakeClassnameTags123ApiServiceFactory.java @@ -0,0 +1,13 @@ +package io.swagger.api.factories; + +import io.swagger.api.FakeClassnameTags123ApiService; +import io.swagger.api.impl.FakeClassnameTags123ApiServiceImpl; + + +public class FakeClassnameTags123ApiServiceFactory { + private final static FakeClassnameTags123ApiService service = new FakeClassnameTags123ApiServiceImpl(); + + public static FakeClassnameTags123ApiService getFakeClassnameTags123Api() { + return service; + } +} diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/factories/FakeClassnameTestApiServiceFactory.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/factories/FakeClassnameTestApiServiceFactory.java deleted file mode 100644 index dc123113010..00000000000 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/factories/FakeClassnameTestApiServiceFactory.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.swagger.api.factories; - -import io.swagger.api.FakeClassnameTestApiService; -import io.swagger.api.impl.FakeClassnameTestApiServiceImpl; - - -public class FakeClassnameTestApiServiceFactory { - private final static FakeClassnameTestApiService service = new FakeClassnameTestApiServiceImpl(); - - public static FakeClassnameTestApiService getFakeClassnameTestApi() { - return service; - } -} diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTestApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java similarity index 88% rename from samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTestApiServiceImpl.java rename to samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java index 2d77e24e3e4..61301d3617b 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTestApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java @@ -16,7 +16,7 @@ import javax.ws.rs.core.SecurityContext; import javax.validation.constraints.*; -public class FakeClassnameTestApiServiceImpl extends FakeClassnameTestApiService { +public class FakeClassnameTags123ApiServiceImpl extends FakeClassnameTags123ApiService { @Override public Response testClassname(Client body, SecurityContext securityContext) throws NotFoundException { // do some magic! diff --git a/samples/server/petstore/jaxrs/jersey2/README.md b/samples/server/petstore/jaxrs/jersey2/README.md index 4e7da8b7f63..faa1cc0c2b7 100644 --- a/samples/server/petstore/jaxrs/jersey2/README.md +++ b/samples/server/petstore/jaxrs/jersey2/README.md @@ -1,4 +1,4 @@ -# Swagger Jersey 2 generated server +# Swagger Jersey generated server ## Overview This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApi.java index 8935f8b3d79..7e933d3d0c0 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApi.java @@ -12,6 +12,7 @@ import java.util.Date; import io.swagger.model.OuterComposite; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -120,13 +121,13 @@ public Response testClientModel(@ApiParam(value = "client model" ,required=true) @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "http_basic_test") }, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response testEndpointParameters(@ApiParam(value = "None", required=true) @FormParam("number") BigDecimal number ,@ApiParam(value = "None", required=true) @FormParam("double") Double _double ,@ApiParam(value = "None", required=true) @FormParam("pattern_without_delimiter") String patternWithoutDelimiter @@ -149,11 +150,11 @@ public Response testEndpointParameters(@ApiParam(value = "None", required=true) @Consumes({ "*/*" }) @Produces({ "*/*" }) - @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = void.class, tags={ "fake", }) + @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) }) public Response testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @FormParam("enum_form_string_array") List enumFormStringArray ,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString ,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $")@HeaderParam("enum_header_string_array") List enumHeaderStringArray @@ -170,9 +171,9 @@ public Response testEnumParameters(@ApiParam(value = "Form parameter enum test ( @Path("/jsonFormData") @Consumes({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = void.class, tags={ "fake", }) + @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response testJsonFormData(@ApiParam(value = "field1", required=true) @FormParam("param") String param ,@ApiParam(value = "field2", required=true) @FormParam("param2") String param2 ,@Context SecurityContext securityContext) diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeClassnameTestApi.java index 0985867b529..d72e946b99a 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeClassnameTestApi.java @@ -9,6 +9,7 @@ import io.swagger.model.Client; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/PetApi.java index 30b1eece3c8..0ce48e9ecb3 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/PetApi.java @@ -11,6 +11,7 @@ import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -59,14 +60,14 @@ public PetApi(@Context ServletConfig servletContext) { @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body ,@Context SecurityContext securityContext) throws NotFoundException { @@ -76,14 +77,14 @@ public Response addPet(@ApiParam(value = "Pet object that needs to be added to t @Path("/{petId}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId ,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey ,@Context SecurityContext securityContext) @@ -103,7 +104,7 @@ public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @P @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="available, pending, sold") @QueryParam("status") List status ,@Context SecurityContext securityContext) throws NotFoundException { @@ -122,7 +123,7 @@ public Response findPetsByStatus(@ApiParam(value = "Status values that need to b @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags(@ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags ,@Context SecurityContext securityContext) throws NotFoundException { @@ -138,9 +139,9 @@ public Response findPetsByTags(@ApiParam(value = "Tags to filter by",required=tr @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId ,@Context SecurityContext securityContext) throws NotFoundException { @@ -150,18 +151,18 @@ public Response getPetById(@ApiParam(value = "ID of pet to return",required=true @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = void.class), + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body ,@Context SecurityContext securityContext) throws NotFoundException { @@ -171,14 +172,14 @@ public Response updatePet(@ApiParam(value = "Pet object that needs to be added t @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = void.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") Long petId ,@ApiParam(value = "Updated name of the pet") @FormParam("name") String name ,@ApiParam(value = "Updated status of the pet") @FormParam("status") String status diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/StoreApi.java index 18c5a14979c..ab75794709c 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/StoreApi.java @@ -10,6 +10,7 @@ import java.util.Map; import io.swagger.model.Order; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -58,11 +59,11 @@ public StoreApi(@Context ServletConfig servletContext) { @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = void.class, tags={ "store", }) + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("order_id") String orderId ,@Context SecurityContext securityContext) throws NotFoundException { @@ -76,7 +77,7 @@ public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { return delegate.getInventory(securityContext); @@ -89,9 +90,9 @@ public Response getInventory(@Context SecurityContext securityContext) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("order_id") Long orderId ,@Context SecurityContext securityContext) throws NotFoundException { @@ -105,7 +106,7 @@ public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetch @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body ,@Context SecurityContext securityContext) throws NotFoundException { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/UserApi.java index 1a0225db3c2..3cc93e9043c 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/UserApi.java @@ -10,6 +10,7 @@ import java.util.List; import io.swagger.model.User; +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -58,9 +59,9 @@ public UserApi(@Context ServletConfig servletContext) { @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body ,@Context SecurityContext securityContext) throws NotFoundException { @@ -70,9 +71,9 @@ public Response createUser(@ApiParam(value = "Created user object" ,required=tru @Path("/createWithArray") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body ,@Context SecurityContext securityContext) throws NotFoundException { @@ -82,9 +83,9 @@ public Response createUsersWithArrayInput(@ApiParam(value = "List of user object @Path("/createWithList") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body ,@Context SecurityContext securityContext) throws NotFoundException { @@ -94,11 +95,11 @@ public Response createUsersWithListInput(@ApiParam(value = "List of user object" @Path("/{username}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathParam("username") String username ,@Context SecurityContext securityContext) throws NotFoundException { @@ -112,9 +113,9 @@ public Response deleteUser(@ApiParam(value = "The name that needs to be deleted" @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true) @PathParam("username") String username ,@Context SecurityContext securityContext) throws NotFoundException { @@ -128,7 +129,7 @@ public Response getUserByName(@ApiParam(value = "The name that needs to be fetch @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) public Response loginUser(@ApiParam(value = "The user name for login",required=true) @QueryParam("username") String username ,@ApiParam(value = "The password for login in clear text",required=true) @QueryParam("password") String password ,@Context SecurityContext securityContext) @@ -139,9 +140,9 @@ public Response loginUser(@ApiParam(value = "The user name for login",required=t @Path("/logout") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response logoutUser(@Context SecurityContext securityContext) throws NotFoundException { return delegate.logoutUser(securityContext); @@ -150,11 +151,11 @@ public Response logoutUser(@Context SecurityContext securityContext) @Path("/{username}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username ,@ApiParam(value = "Updated user object" ,required=true) User body ,@Context SecurityContext securityContext) diff --git a/samples/server/petstore/jaxrs/jersey2/src/test/java/io/swagger/model/CapitalizationTest.java b/samples/server/petstore/jaxrs/jersey2/src/test/java/io/swagger/model/CapitalizationTest.java deleted file mode 100644 index 179b064248f..00000000000 --- a/samples/server/petstore/jaxrs/jersey2/src/test/java/io/swagger/model/CapitalizationTest.java +++ /dev/null @@ -1,69 +0,0 @@ -package io.swagger.model; - -import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.*; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import org.junit.Before; -import org.junit.Test; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - -/** - * Tests JSON representation of - */ -public class CapitalizationTest { - - private static final String SMALL_CAMEL = "smallCamel"; - private static final String SMALL_SNAKE = "small_Snake"; - private static final String CAPITAL_CAMEL = "CapitalCamel"; - private static final String CAPITAL_SNAKE = "Capital_Snake"; - - private static final String SCA_ETH_FLOW_POINTS = "SCA_ETH_Flow_Points"; - private static final String ATT_NAME = "ATT_NAME"; - - private static final ObjectMapper MAPPER = new ObjectMapper(); - - private static final Set EXPECTED - = new HashSet<>(Arrays.asList(SMALL_CAMEL, - SMALL_SNAKE, - CAPITAL_CAMEL, - CAPITAL_SNAKE, - SCA_ETH_FLOW_POINTS, - ATT_NAME)); - - private Capitalization sut; - - - @Before - public void setUp() { - sut = new Capitalization(); - sut.smallCamel(SMALL_CAMEL); - sut.smallSnake(SMALL_SNAKE); - sut.capitalCamel(CAPITAL_CAMEL); - sut.capitalSnake(CAPITAL_SNAKE); - sut.setScAETHFlowPoints(SCA_ETH_FLOW_POINTS); - sut.setATTNAME(ATT_NAME); - } - - @Test - public void test() throws JsonProcessingException { - - JsonNode json = MAPPER.valueToTree(sut); - - Set fields = new HashSet<>(); - Iterator it = json.fieldNames(); - while (it.hasNext()) { - fields.add(it.next()); - } - - assertThat(fields, is(equalTo(EXPECTED))); - } - -}