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..6bcc15a91b6 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 @@ -16,7 +16,6 @@ import io.swagger.codegen.CodegenResponse; import io.swagger.codegen.CodegenType; import io.swagger.codegen.languages.features.BeanValidationFeatures; -import io.swagger.codegen.languages.features.UseGenericResponseFeatures; import io.swagger.models.Operation; import io.swagger.models.Path; import io.swagger.models.Swagger; @@ -139,7 +138,7 @@ public Map postProcessOperations(Map objs) { if ( operations != null ) { @SuppressWarnings("unchecked") List ops = (List) operations.get("operation"); - for ( CodegenOperation operation : ops ) { + for ( final CodegenOperation operation : ops ) { boolean isMultipartPost = false; List> consumes = operation.consumes; if(consumes != null) { @@ -161,23 +160,50 @@ public Map postProcessOperations(Map objs) { List responses = operation.responses; if ( responses != null ) { - for ( CodegenResponse resp : responses ) { + for ( final CodegenResponse resp : responses ) { if ( "0".equals(resp.code) ) { resp.code = "200"; } + final String responseReturnType = resp.dataType; // set vendorExtensions.x-java-is-response-void to true as dataType is set to "void" - if (resp.dataType == null) { + if (responseReturnType == null) { resp.vendorExtensions.put("x-java-is-response-void", true); } - + + String rt = responseReturnType; + if (rt == null || rt.trim().isEmpty()) { + resp.dataType = "Void"; + resp.baseType = "Void"; + } else if (rt.startsWith("List")) { + int end = rt.lastIndexOf(">"); + if (end > 0) { + resp.dataType = rt.substring("List<".length(), end).trim(); + resp.baseType = rt.substring("List<".length(), end).trim(); + resp.containerType = "List"; + } + } else if (rt.startsWith("Map")) { + int end = rt.lastIndexOf(">"); + if (end > 0) { + resp.dataType = rt.substring("Map<".length(), end).split(",")[1].trim(); + resp.baseType = rt.substring("Map<".length(), end).split(",")[1].trim(); + resp.containerType = "Map"; + } + } else if (rt.startsWith("Set")) { + int end = rt.lastIndexOf(">"); + if (end > 0) { + resp.dataType = rt.substring("Set<".length(), end).trim(); + resp.baseType = rt.substring("Set<".length(), end).trim(); + resp.containerType = "Set"; + } + } } } if ( operation.returnType == null ) { operation.returnType = "void"; - // set vendorExtensions.x-java-is-response-void to true as returnType is set to "void" - operation.vendorExtensions.put("x-java-is-response-void", true); + // set vendorExtensions.x-java-is-response-void to true as returnType 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(">"); @@ -191,7 +217,7 @@ public Map postProcessOperations(Map objs) { 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(">"); @@ -242,5 +268,11 @@ public void setUseBeanValidation(boolean useBeanValidation) { this.useBeanValidation = useBeanValidation; } - + /** + * Interface to set the data types for different Codegen objects. + */ + private interface DataTypeAssigner { + void setReturnType(String returnType); + void setReturnContainer(String returnContainer); + } } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/api.mustache index 20cd3c87db5..a6b94d50045 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/api.mustache @@ -70,7 +70,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..6c8d765c14e 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 @@ -50,7 +50,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/libraries/jersey1/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache index a3b9628f97b..382242a401c 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 @@ -50,7 +50,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/spec/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/api.mustache index 5b8f44ca3e9..c22d8c97cc1 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/api.mustache @@ -36,7 +36,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/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java index 2986033bae2..1d332a76d97 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java @@ -13,15 +13,18 @@ package io.swagger.client.model; +import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - -import javax.validation.Valid; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; -import java.util.Objects; import java.util.UUID; +import javax.validation.constraints.*; +import javax.validation.Valid; /** * FormatTest diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 7fe69e168fd..0c24badae38 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -41,7 +41,7 @@ public AdditionalPropertiesClass mapProperty(Map mapProperty) { public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { if (this.mapProperty == null) { - this.mapProperty = new HashMap(); + this.mapProperty = new HashMap<>(); } this.mapProperty.put(key, mapPropertyItem); return this; @@ -67,7 +67,7 @@ public AdditionalPropertiesClass mapOfMapProperty(Map mapOfMapPropertyItem) { if (this.mapOfMapProperty == null) { - this.mapOfMapProperty = new HashMap>(); + this.mapOfMapProperty = new HashMap<>(); } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index b7e59a030a4..5997b31cbd4 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -38,7 +38,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index fdfeb6856f3..2bc17f88eb3 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -38,7 +38,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayTest.java index 62665c2536a..6804a14e313 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayTest.java @@ -44,7 +44,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -70,7 +70,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -96,7 +96,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumArrays.java index 12caa480285..133a31f10b9 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumArrays.java @@ -128,7 +128,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MapTest.java index e6344a1df0f..31a7dae7253 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MapTest.java @@ -76,7 +76,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -102,7 +102,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 29bfc7e8c08..1691e985f4f 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -83,7 +83,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Pet.java index 4c351dec3e4..6ece90bbfc3 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Pet.java @@ -39,7 +39,7 @@ public class Pet { private String name = null; @JsonProperty("photoUrls") - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") private List tags = null; @@ -168,7 +168,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/client/petstore/javascript-closure-angular/.swagger-codegen/VERSION b/samples/client/petstore/javascript-closure-angular/.swagger-codegen/VERSION index 7fea99011a6..f9f7450d135 100644 --- a/samples/client/petstore/javascript-closure-angular/.swagger-codegen/VERSION +++ b/samples/client/petstore/javascript-closure-angular/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/StoreApi.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/StoreApi.java index 8ddeb8f3dea..f6f1a5ae047 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/StoreApi.java @@ -38,7 +38,7 @@ public interface StoreApi { @Produces({ "application/json" }) @ApiOperation(value = "Returns pet inventories by status", tags={ "store", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) + @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) public Map getInventory(); @GET 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/java-inflector/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Cat.java index 96c7697990d..e26e6253685 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Cat.java @@ -26,7 +26,7 @@ public Cat declawed(Boolean declawed) { @ApiModelProperty(value = "") @JsonProperty("declawed") - public Boolean getDeclawed() { + public Boolean isDeclawed() { return declawed; } public void setDeclawed(Boolean declawed) { diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Order.java index 324a686eb8b..6cf0c39769f 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Order.java @@ -161,7 +161,7 @@ public Order complete(Boolean complete) { @ApiModelProperty(value = "") @JsonProperty("complete") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } public void setComplete(Boolean complete) { diff --git a/samples/server/petstore/java-inflector/src/main/java/io/swagger/controllers/FakeController.java b/samples/server/petstore/java-inflector/src/main/java/io/swagger/controllers/FakeController.java index 17cebd09aa3..9be14b1dca7 100644 --- a/samples/server/petstore/java-inflector/src/main/java/io/swagger/controllers/FakeController.java +++ b/samples/server/petstore/java-inflector/src/main/java/io/swagger/controllers/FakeController.java @@ -65,5 +65,11 @@ public ResponseContext testEnumParameters(RequestContext request , List } */ + /* + public ResponseContext testJsonFormData(RequestContext request , String param, String param2) { + return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); + } + */ + } diff --git a/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml b/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml index c228c799477..2ccdbff36b4 100644 --- a/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml +++ b/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml @@ -163,6 +163,7 @@ paths: - petstore_auth: - "write:pets" - "read:pets" + deprecated: true x-contentType: "application/json" x-accepts: "application/json" /pet/{petId}: @@ -626,6 +627,8 @@ paths: description: "successful operation" schema: $ref: "#/definitions/Client" + security: + - api_key_query: [] x-contentType: "application/json" x-accepts: "application/json" /fake: @@ -948,6 +951,31 @@ paths: $ref: "#/definitions/OuterComposite" x-contentType: "application/json" x-accepts: "application/json" + /fake/jsonFormData: + get: + tags: + - "fake" + summary: "test json serialization of form data" + description: "" + operationId: "testJsonFormData" + consumes: + - "application/json" + parameters: + - name: "param" + in: "formData" + description: "field1" + required: true + type: "string" + - name: "param2" + in: "formData" + description: "field2" + required: true + type: "string" + responses: + 200: + description: "successful operation" + x-contentType: "application/json" + x-accepts: "application/json" securityDefinitions: petstore_auth: type: "oauth2" @@ -960,6 +988,10 @@ securityDefinitions: type: "apiKey" name: "api_key" in: "header" + api_key_query: + type: "apiKey" + name: "api_key_query" + in: "query" http_basic_test: type: "basic" definitions: @@ -989,12 +1021,12 @@ definitions: type: "boolean" default: false example: - petId: 6 - quantity: 1 id: 0 - shipDate: "2000-01-23T04:56:07.000+00:00" + petId: 6 complete: false status: "placed" + quantity: 1 + shipDate: "2000-01-23T04:56:07.000+00:00" xml: name: "Order" Category: @@ -1006,8 +1038,8 @@ definitions: name: type: "string" example: - name: "aeiou" id: 6 + name: "name" xml: name: "Category" User: @@ -1034,14 +1066,14 @@ definitions: format: "int32" description: "User Status" example: - firstName: "aeiou" - lastName: "aeiou" - password: "aeiou" - userStatus: 6 - phone: "aeiou" id: 0 - email: "aeiou" - username: "aeiou" + lastName: "lastName" + phone: "phone" + username: "username" + email: "email" + userStatus: 6 + firstName: "firstName" + password: "password" xml: name: "User" Tag: @@ -1053,8 +1085,8 @@ definitions: name: type: "string" example: - name: "aeiou" id: 1 + name: "name" xml: name: "Tag" Pet: @@ -1094,17 +1126,20 @@ definitions: - "pending" - "sold" example: - photoUrls: - - "aeiou" - name: "doggie" + tags: + - id: 1 + name: "name" + - id: 1 + name: "name" id: 0 category: - name: "aeiou" id: 6 - tags: - - name: "aeiou" - id: 1 + name: "name" status: "available" + name: "doggie" + photoUrls: + - "photoUrls" + - "photoUrls" xml: name: "Pet" ApiResponse: @@ -1118,9 +1153,9 @@ definitions: message: type: "string" example: + message: "message" code: 0 - type: "aeiou" - message: "aeiou" + type: "type" $special[model.name]: properties: $special[property.name]: @@ -1239,6 +1274,7 @@ definitions: byte: type: "string" format: "byte" + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" binary: type: "string" format: "binary" @@ -1323,7 +1359,7 @@ definitions: client: type: "string" example: - client: "aeiou" + client: "client" ReadOnlyFirst: type: "object" properties: @@ -1451,8 +1487,8 @@ definitions: my_boolean: $ref: "#/definitions/OuterBoolean" example: - my_string: {} my_number: {} + my_string: {} my_boolean: {} externalDocs: description: "Find out more about Swagger" diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApi.java index 81939d3931a..81e7d121ebc 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApi.java @@ -143,4 +143,17 @@ public Response testEnumParameters(@ApiParam(value = "Form parameter enum test ( throws NotFoundException { return delegate.testEnumParameters(enumFormStringArray,enumFormString,enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,enumQueryDouble); } + @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.ApiResponses(value = { + @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 +) + throws NotFoundException { + return delegate.testJsonFormData(param,param2); + } } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApiService.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApiService.java index fb27855c5f0..000d23e0b69 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApiService.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApiService.java @@ -54,5 +54,8 @@ public abstract Response testEnumParameters(List enumFormStringArray ,String enumQueryString ,Integer enumQueryInteger ,Double enumQueryDouble + ) throws NotFoundException; + public abstract Response testJsonFormData(String param + ,String param2 ) throws NotFoundException; } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeClassnameTestApi.java index e9ef534e111..3dda40feaa9 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeClassnameTestApi.java @@ -34,7 +34,9 @@ public class FakeClassnameTestApi { @Consumes({ "application/json" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, tags={ "fake_classname_tags 123#$%^", }) + @io.swagger.annotations.ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { + @io.swagger.annotations.Authorization(value = "api_key_query") + }, tags={ "fake_classname_tags 123#$%^", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) public Response testClassname(@ApiParam(value = "client model" ,required=true) Client body diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Cat.java index 95bea570923..04bdb3cbd41 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Cat.java @@ -25,7 +25,7 @@ public Cat declawed(Boolean declawed) { * @return declawed **/ @ApiModelProperty(value = "") - public Boolean getDeclawed() { + public Boolean isDeclawed() { return declawed; } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Order.java index 1dfe20badf0..5146e0f12e9 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Order.java @@ -164,7 +164,7 @@ public Order complete(Boolean complete) { * @return complete **/ @ApiModelProperty(value = "") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } diff --git a/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java index 807fdc0859a..5e08fdcdefe 100644 --- a/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java @@ -79,6 +79,13 @@ public Response testEnumParameters(List enumFormStringArray , String enumQueryString , Integer enumQueryInteger , Double enumQueryDouble + ) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response testJsonFormData(String param +, String param2 ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/java-play-framework-controller-only/public/swagger.json b/samples/server/petstore/java-play-framework-controller-only/public/swagger.json index bf0a7a26545..6cdf4cc1a5a 100644 --- a/samples/server/petstore/java-play-framework-controller-only/public/swagger.json +++ b/samples/server/petstore/java-play-framework-controller-only/public/swagger.json @@ -725,12 +725,12 @@ "title" : "Pet Order", "description" : "An order for a pets from the pet store", "example" : { - "petId" : 6, - "quantity" : 1, "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", + "petId" : 6, "complete" : false, - "status" : "placed" + "status" : "placed", + "quantity" : 1, + "shipDate" : "2000-01-23T04:56:07.000+00:00" }, "xml" : { "name" : "Order" @@ -750,8 +750,8 @@ "title" : "Pet catehgry", "description" : "A category for a pet", "example" : { - "name" : "name", - "id" : 6 + "id" : 6, + "name" : "name" }, "xml" : { "name" : "Category" @@ -791,14 +791,14 @@ "title" : "a User", "description" : "A User who is purchasing from the pet store", "example" : { - "firstName" : "firstName", + "id" : 0, "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, "phone" : "phone", - "id" : 0, + "username" : "username", "email" : "email", - "username" : "username" + "userStatus" : 6, + "firstName" : "firstName", + "password" : "password" }, "xml" : { "name" : "User" @@ -818,8 +818,8 @@ "title" : "Pet Tag", "description" : "A tag for a pet", "example" : { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" }, "xml" : { "name" : "Tag" @@ -869,21 +869,21 @@ "title" : "a Pet", "description" : "A pet for sale in the pet store", "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, "tags" : [ { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" }, { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" } ], - "status" : "available" + "id" : 0, + "category" : { + "id" : 6, + "name" : "name" + }, + "status" : "available", + "name" : "doggie", + "photoUrls" : [ "photoUrls", "photoUrls" ] }, "xml" : { "name" : "Pet" @@ -906,9 +906,9 @@ "title" : "An uploaded response", "description" : "Describes the result of uploading an image resource", "example" : { + "message" : "message", "code" : 0, - "type" : "type", - "message" : "message" + "type" : "type" } } }, diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/public/swagger.json b/samples/server/petstore/java-play-framework-fake-endpoints/public/swagger.json index b6ec73c0ce2..196bf6f5e5e 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/public/swagger.json +++ b/samples/server/petstore/java-play-framework-fake-endpoints/public/swagger.json @@ -1144,12 +1144,12 @@ } }, "example" : { - "petId" : 6, - "quantity" : 1, "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", + "petId" : 6, "complete" : false, - "status" : "placed" + "status" : "placed", + "quantity" : 1, + "shipDate" : "2000-01-23T04:56:07.000+00:00" }, "xml" : { "name" : "Order" @@ -1167,8 +1167,8 @@ } }, "example" : { - "name" : "name", - "id" : 6 + "id" : 6, + "name" : "name" }, "xml" : { "name" : "Category" @@ -1207,14 +1207,14 @@ } }, "example" : { - "firstName" : "firstName", + "id" : 0, "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, "phone" : "phone", - "id" : 0, + "username" : "username", "email" : "email", - "username" : "username" + "userStatus" : 6, + "firstName" : "firstName", + "password" : "password" }, "xml" : { "name" : "User" @@ -1232,8 +1232,8 @@ } }, "example" : { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" }, "xml" : { "name" : "Tag" @@ -1282,21 +1282,21 @@ } }, "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, "tags" : [ { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" }, { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" } ], - "status" : "available" + "id" : 0, + "category" : { + "id" : 6, + "name" : "name" + }, + "status" : "available", + "name" : "doggie", + "photoUrls" : [ "photoUrls", "photoUrls" ] }, "xml" : { "name" : "Pet" @@ -1317,9 +1317,9 @@ } }, "example" : { + "message" : "message", "code" : 0, - "type" : "type", - "message" : "message" + "type" : "type" } }, "$special[model.name]" : { @@ -1767,8 +1767,8 @@ } }, "example" : { - "my_string" : { }, "my_number" : { }, + "my_string" : { }, "my_boolean" : { } } } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/public/swagger.json b/samples/server/petstore/java-play-framework-no-bean-validation/public/swagger.json index bf0a7a26545..6cdf4cc1a5a 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/public/swagger.json +++ b/samples/server/petstore/java-play-framework-no-bean-validation/public/swagger.json @@ -725,12 +725,12 @@ "title" : "Pet Order", "description" : "An order for a pets from the pet store", "example" : { - "petId" : 6, - "quantity" : 1, "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", + "petId" : 6, "complete" : false, - "status" : "placed" + "status" : "placed", + "quantity" : 1, + "shipDate" : "2000-01-23T04:56:07.000+00:00" }, "xml" : { "name" : "Order" @@ -750,8 +750,8 @@ "title" : "Pet catehgry", "description" : "A category for a pet", "example" : { - "name" : "name", - "id" : 6 + "id" : 6, + "name" : "name" }, "xml" : { "name" : "Category" @@ -791,14 +791,14 @@ "title" : "a User", "description" : "A User who is purchasing from the pet store", "example" : { - "firstName" : "firstName", + "id" : 0, "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, "phone" : "phone", - "id" : 0, + "username" : "username", "email" : "email", - "username" : "username" + "userStatus" : 6, + "firstName" : "firstName", + "password" : "password" }, "xml" : { "name" : "User" @@ -818,8 +818,8 @@ "title" : "Pet Tag", "description" : "A tag for a pet", "example" : { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" }, "xml" : { "name" : "Tag" @@ -869,21 +869,21 @@ "title" : "a Pet", "description" : "A pet for sale in the pet store", "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, "tags" : [ { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" }, { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" } ], - "status" : "available" + "id" : 0, + "category" : { + "id" : 6, + "name" : "name" + }, + "status" : "available", + "name" : "doggie", + "photoUrls" : [ "photoUrls", "photoUrls" ] }, "xml" : { "name" : "Pet" @@ -906,9 +906,9 @@ "title" : "An uploaded response", "description" : "Describes the result of uploading an image resource", "example" : { + "message" : "message", "code" : 0, - "type" : "type", - "message" : "message" + "type" : "type" } } }, diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/public/swagger.json b/samples/server/petstore/java-play-framework-no-exception-handling/public/swagger.json index bf0a7a26545..6cdf4cc1a5a 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/public/swagger.json +++ b/samples/server/petstore/java-play-framework-no-exception-handling/public/swagger.json @@ -725,12 +725,12 @@ "title" : "Pet Order", "description" : "An order for a pets from the pet store", "example" : { - "petId" : 6, - "quantity" : 1, "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", + "petId" : 6, "complete" : false, - "status" : "placed" + "status" : "placed", + "quantity" : 1, + "shipDate" : "2000-01-23T04:56:07.000+00:00" }, "xml" : { "name" : "Order" @@ -750,8 +750,8 @@ "title" : "Pet catehgry", "description" : "A category for a pet", "example" : { - "name" : "name", - "id" : 6 + "id" : 6, + "name" : "name" }, "xml" : { "name" : "Category" @@ -791,14 +791,14 @@ "title" : "a User", "description" : "A User who is purchasing from the pet store", "example" : { - "firstName" : "firstName", + "id" : 0, "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, "phone" : "phone", - "id" : 0, + "username" : "username", "email" : "email", - "username" : "username" + "userStatus" : 6, + "firstName" : "firstName", + "password" : "password" }, "xml" : { "name" : "User" @@ -818,8 +818,8 @@ "title" : "Pet Tag", "description" : "A tag for a pet", "example" : { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" }, "xml" : { "name" : "Tag" @@ -869,21 +869,21 @@ "title" : "a Pet", "description" : "A pet for sale in the pet store", "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, "tags" : [ { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" }, { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" } ], - "status" : "available" + "id" : 0, + "category" : { + "id" : 6, + "name" : "name" + }, + "status" : "available", + "name" : "doggie", + "photoUrls" : [ "photoUrls", "photoUrls" ] }, "xml" : { "name" : "Pet" @@ -906,9 +906,9 @@ "title" : "An uploaded response", "description" : "Describes the result of uploading an image resource", "example" : { + "message" : "message", "code" : 0, - "type" : "type", - "message" : "message" + "type" : "type" } } }, diff --git a/samples/server/petstore/java-play-framework-no-interface/public/swagger.json b/samples/server/petstore/java-play-framework-no-interface/public/swagger.json index bf0a7a26545..6cdf4cc1a5a 100644 --- a/samples/server/petstore/java-play-framework-no-interface/public/swagger.json +++ b/samples/server/petstore/java-play-framework-no-interface/public/swagger.json @@ -725,12 +725,12 @@ "title" : "Pet Order", "description" : "An order for a pets from the pet store", "example" : { - "petId" : 6, - "quantity" : 1, "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", + "petId" : 6, "complete" : false, - "status" : "placed" + "status" : "placed", + "quantity" : 1, + "shipDate" : "2000-01-23T04:56:07.000+00:00" }, "xml" : { "name" : "Order" @@ -750,8 +750,8 @@ "title" : "Pet catehgry", "description" : "A category for a pet", "example" : { - "name" : "name", - "id" : 6 + "id" : 6, + "name" : "name" }, "xml" : { "name" : "Category" @@ -791,14 +791,14 @@ "title" : "a User", "description" : "A User who is purchasing from the pet store", "example" : { - "firstName" : "firstName", + "id" : 0, "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, "phone" : "phone", - "id" : 0, + "username" : "username", "email" : "email", - "username" : "username" + "userStatus" : 6, + "firstName" : "firstName", + "password" : "password" }, "xml" : { "name" : "User" @@ -818,8 +818,8 @@ "title" : "Pet Tag", "description" : "A tag for a pet", "example" : { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" }, "xml" : { "name" : "Tag" @@ -869,21 +869,21 @@ "title" : "a Pet", "description" : "A pet for sale in the pet store", "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, "tags" : [ { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" }, { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" } ], - "status" : "available" + "id" : 0, + "category" : { + "id" : 6, + "name" : "name" + }, + "status" : "available", + "name" : "doggie", + "photoUrls" : [ "photoUrls", "photoUrls" ] }, "xml" : { "name" : "Pet" @@ -906,9 +906,9 @@ "title" : "An uploaded response", "description" : "Describes the result of uploading an image resource", "example" : { + "message" : "message", "code" : 0, - "type" : "type", - "message" : "message" + "type" : "type" } } }, diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/public/swagger.json b/samples/server/petstore/java-play-framework-no-wrap-calls/public/swagger.json index bf0a7a26545..6cdf4cc1a5a 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/public/swagger.json +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/public/swagger.json @@ -725,12 +725,12 @@ "title" : "Pet Order", "description" : "An order for a pets from the pet store", "example" : { - "petId" : 6, - "quantity" : 1, "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", + "petId" : 6, "complete" : false, - "status" : "placed" + "status" : "placed", + "quantity" : 1, + "shipDate" : "2000-01-23T04:56:07.000+00:00" }, "xml" : { "name" : "Order" @@ -750,8 +750,8 @@ "title" : "Pet catehgry", "description" : "A category for a pet", "example" : { - "name" : "name", - "id" : 6 + "id" : 6, + "name" : "name" }, "xml" : { "name" : "Category" @@ -791,14 +791,14 @@ "title" : "a User", "description" : "A User who is purchasing from the pet store", "example" : { - "firstName" : "firstName", + "id" : 0, "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, "phone" : "phone", - "id" : 0, + "username" : "username", "email" : "email", - "username" : "username" + "userStatus" : 6, + "firstName" : "firstName", + "password" : "password" }, "xml" : { "name" : "User" @@ -818,8 +818,8 @@ "title" : "Pet Tag", "description" : "A tag for a pet", "example" : { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" }, "xml" : { "name" : "Tag" @@ -869,21 +869,21 @@ "title" : "a Pet", "description" : "A pet for sale in the pet store", "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, "tags" : [ { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" }, { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" } ], - "status" : "available" + "id" : 0, + "category" : { + "id" : 6, + "name" : "name" + }, + "status" : "available", + "name" : "doggie", + "photoUrls" : [ "photoUrls", "photoUrls" ] }, "xml" : { "name" : "Pet" @@ -906,9 +906,9 @@ "title" : "An uploaded response", "description" : "Describes the result of uploading an image resource", "example" : { + "message" : "message", "code" : 0, - "type" : "type", - "message" : "message" + "type" : "type" } } }, diff --git a/samples/server/petstore/java-play-framework/public/swagger.json b/samples/server/petstore/java-play-framework/public/swagger.json index bf0a7a26545..6cdf4cc1a5a 100644 --- a/samples/server/petstore/java-play-framework/public/swagger.json +++ b/samples/server/petstore/java-play-framework/public/swagger.json @@ -725,12 +725,12 @@ "title" : "Pet Order", "description" : "An order for a pets from the pet store", "example" : { - "petId" : 6, - "quantity" : 1, "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", + "petId" : 6, "complete" : false, - "status" : "placed" + "status" : "placed", + "quantity" : 1, + "shipDate" : "2000-01-23T04:56:07.000+00:00" }, "xml" : { "name" : "Order" @@ -750,8 +750,8 @@ "title" : "Pet catehgry", "description" : "A category for a pet", "example" : { - "name" : "name", - "id" : 6 + "id" : 6, + "name" : "name" }, "xml" : { "name" : "Category" @@ -791,14 +791,14 @@ "title" : "a User", "description" : "A User who is purchasing from the pet store", "example" : { - "firstName" : "firstName", + "id" : 0, "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, "phone" : "phone", - "id" : 0, + "username" : "username", "email" : "email", - "username" : "username" + "userStatus" : 6, + "firstName" : "firstName", + "password" : "password" }, "xml" : { "name" : "User" @@ -818,8 +818,8 @@ "title" : "Pet Tag", "description" : "A tag for a pet", "example" : { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" }, "xml" : { "name" : "Tag" @@ -869,21 +869,21 @@ "title" : "a Pet", "description" : "A pet for sale in the pet store", "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, "tags" : [ { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" }, { - "name" : "name", - "id" : 1 + "id" : 1, + "name" : "name" } ], - "status" : "available" + "id" : 0, + "category" : { + "id" : 6, + "name" : "name" + }, + "status" : "available", + "name" : "doggie", + "photoUrls" : [ "photoUrls", "photoUrls" ] }, "xml" : { "name" : "Pet" @@ -906,9 +906,9 @@ "title" : "An uploaded response", "description" : "Describes the result of uploading an image resource", "example" : { + "message" : "message", "code" : 0, - "type" : "type", - "message" : "message" + "type" : "type" } } }, diff --git a/samples/server/petstore/java-vertx/async/.swagger-codegen/VERSION b/samples/server/petstore/java-vertx/async/.swagger-codegen/VERSION index 7fea99011a6..f9f7450d135 100644 --- a/samples/server/petstore/java-vertx/async/.swagger-codegen/VERSION +++ b/samples/server/petstore/java-vertx/async/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Order.java b/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Order.java index 9e7d41ff04c..0eaaa46f352 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Order.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Order.java @@ -99,7 +99,7 @@ public void setStatus(StatusEnum status) { @JsonProperty("complete") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } public void setComplete(Boolean complete) { diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Pet.java b/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Pet.java index 8b3181be26e..e975a8dc2b2 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Pet.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Pet.java @@ -18,8 +18,8 @@ public class Pet { private Long id = null; private Category category = null; private String name = null; - private List photoUrls = new ArrayList(); - private List tags = new ArrayList(); + private List photoUrls = new ArrayList<>(); + private List tags = new ArrayList<>(); public enum StatusEnum { diff --git a/samples/server/petstore/java-vertx/async/src/main/resources/swagger.json b/samples/server/petstore/java-vertx/async/src/main/resources/swagger.json index 25192459c61..237d5c2f56f 100644 --- a/samples/server/petstore/java-vertx/async/src/main/resources/swagger.json +++ b/samples/server/petstore/java-vertx/async/src/main/resources/swagger.json @@ -173,6 +173,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "deprecated" : true, "x-contentType" : "application/json", "x-accepts" : "application/json" } diff --git a/samples/server/petstore/java-vertx/rx/.swagger-codegen/VERSION b/samples/server/petstore/java-vertx/rx/.swagger-codegen/VERSION index 7fea99011a6..f9f7450d135 100644 --- a/samples/server/petstore/java-vertx/rx/.swagger-codegen/VERSION +++ b/samples/server/petstore/java-vertx/rx/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Order.java b/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Order.java index 9e7d41ff04c..0eaaa46f352 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Order.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Order.java @@ -99,7 +99,7 @@ public void setStatus(StatusEnum status) { @JsonProperty("complete") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } public void setComplete(Boolean complete) { diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Pet.java b/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Pet.java index 8b3181be26e..e975a8dc2b2 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Pet.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Pet.java @@ -18,8 +18,8 @@ public class Pet { private Long id = null; private Category category = null; private String name = null; - private List photoUrls = new ArrayList(); - private List tags = new ArrayList(); + private List photoUrls = new ArrayList<>(); + private List tags = new ArrayList<>(); public enum StatusEnum { diff --git a/samples/server/petstore/java-vertx/rx/src/main/resources/swagger.json b/samples/server/petstore/java-vertx/rx/src/main/resources/swagger.json index 25192459c61..237d5c2f56f 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/resources/swagger.json +++ b/samples/server/petstore/java-vertx/rx/src/main/resources/swagger.json @@ -173,6 +173,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "deprecated" : true, "x-contentType" : "application/json", "x-accepts" : "application/json" } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java index 0b00a353bc1..7a3d73e8da6 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java @@ -38,7 +38,7 @@ public interface StoreApi { @Produces({ "application/json" }) @ApiOperation(value = "Returns pet inventories by status", tags={ "store", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) + @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) public Map getInventory(); @GET 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..1a1900f5175 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 @@ -46,7 +46,7 @@ public class PetApi { }) }, 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); } @@ -62,7 +62,7 @@ public Response addPet(@ApiParam(value = "Pet object that needs to be added to t }) }, 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 +79,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 +96,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 +110,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); } @@ -127,9 +127,9 @@ public Response getPetById(@ApiParam(value = "ID of pet to return",required=true }) }, 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); } @@ -145,7 +145,7 @@ public Response updatePet(@ApiParam(value = "Pet object that needs to be added t }) }, 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..0361f573ffc 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 @@ -40,8 +40,8 @@ public class StoreApi { @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", }) @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); } @@ -66,8 +66,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 +79,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..f8a33d1e702 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 @@ -40,7 +40,7 @@ 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", }) @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); } @@ -51,7 +51,7 @@ public Response createUser(@ApiParam(value = "Created user object" ,required=tru @Produces({ "application/xml", "application/json" }) @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); } @@ -62,7 +62,7 @@ public Response createUsersWithArrayInput(@ApiParam(value = "List of user object @Produces({ "application/xml", "application/json" }) @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); } @@ -73,8 +73,8 @@ public Response createUsersWithListInput(@ApiParam(value = "List of user object" @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", }) @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 +86,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 +99,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); } @@ -110,7 +110,7 @@ public Response loginUser( @NotNull @ApiParam(value = "The user name for login", @Produces({ "application/xml", "application/json" }) @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); } @@ -121,8 +121,8 @@ public Response logoutUser() { @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" }) @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-non-spring-app/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/StoreApi.java index 8ddeb8f3dea..f6f1a5ae047 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/StoreApi.java @@ -38,7 +38,7 @@ public interface StoreApi { @Produces({ "application/json" }) @ApiOperation(value = "Returns pet inventories by status", tags={ "store", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) + @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) public Map getInventory(); @GET 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-cxf/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java index 2698ca445e6..e745f103635 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java @@ -38,7 +38,7 @@ public interface StoreApi { @Produces({ "application/json" }) @ApiOperation(value = "Returns pet inventories by status", tags={ "store", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) + @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) public Map getInventory(); @GET 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/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-java8/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Pet.java index 0e258641f27..ce855066266 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Pet.java @@ -19,8 +19,8 @@ public class Pet { private Long id = null; private Category category = null; private String name = null; - private List photoUrls = new ArrayList(); - private List tags = new ArrayList(); + private List photoUrls = new ArrayList<>(); + private List tags = new ArrayList<>(); /** * pet status in the store 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/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/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..93b15ba6ed4 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 @@ -86,8 +86,8 @@ public Response testClientModel(Client body) { @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(); } @@ -98,8 +98,8 @@ public Response testEndpointParameters(@FormParam(value = "number") BigDecimal @Produces({ "*/*" }) @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(); } @@ -110,7 +110,7 @@ public Response testEnumParameters(@FormParam(value = "enum_form_string_array") @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..e466b93203a 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 @@ -23,7 +23,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..e042ba05664 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 @@ -32,7 +32,7 @@ public class PetApi { }) }, 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(); } @@ -48,7 +48,7 @@ public Response addPet(Pet body) { }) }, 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 +65,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 +82,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 +96,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(); } @@ -113,9 +113,9 @@ public Response getPetById(@PathParam("petId") @ApiParam("ID of pet to return") }) }, 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(); } @@ -131,7 +131,7 @@ public Response updatePet(Pet body) { }) }, 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..801860cb739 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 @@ -26,8 +26,8 @@ public class StoreApi { @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", }) @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(); } @@ -52,8 +52,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 +65,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..92e59efecce 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 @@ -26,7 +26,7 @@ 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", }) @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(); } @@ -37,7 +37,7 @@ public Response createUser(User body) { @Produces({ "application/xml", "application/json" }) @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(); } @@ -48,7 +48,7 @@ public Response createUsersWithArrayInput(List body) { @Produces({ "application/xml", "application/json" }) @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(); } @@ -59,8 +59,8 @@ public Response createUsersWithListInput(List body) { @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", }) @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 +72,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 +85,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(); } @@ -96,7 +96,7 @@ public Response loginUser(@QueryParam("username") @NotNull String username,@Que @Produces({ "application/xml", "application/json" }) @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(); } @@ -107,8 +107,8 @@ public Response logoutUser() { @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" }) @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..eea72270362 100644 --- a/samples/server/petstore/jaxrs-spec/swagger.json +++ b/samples/server/petstore/jaxrs-spec/swagger.json @@ -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" : { @@ -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..c6f46bc84fe 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 @@ -28,16 +28,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 +50,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 +63,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 +76,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", }) @@ -109,8 +109,8 @@ public Response testClientModel( @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, @@ -136,8 +136,8 @@ public Response testEndpointParameters( @Produces({ "*/*" }) @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 +152,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.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/FakeClassnameTags123Api.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java new file mode 100644 index 00000000000..7d9964444d6 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java @@ -0,0 +1,51 @@ +package io.swagger.api; + +import io.swagger.model.*; +import io.swagger.api.FakeClassnameTags123ApiService; +import io.swagger.api.factories.FakeClassnameTags123ApiServiceFactory; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import com.sun.jersey.multipart.FormDataParam; +import javax.validation.constraints.*; + +import io.swagger.model.Client; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import com.sun.jersey.core.header.FormDataContentDisposition; +import com.sun.jersey.multipart.FormDataParam; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; + +@Path("/FakeClassnameTags123") + + +@io.swagger.annotations.Api(description = "the FakeClassnameTags123 API") + +public class FakeClassnameTags123Api { + private final FakeClassnameTags123ApiService delegate = FakeClassnameTags123ApiServiceFactory.getFakeClassnameTags123Api(); + + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { + @io.swagger.annotations.Authorization(value = "api_key_query") + }, tags={ "fake_classname_tags 123#$%^" }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + public Response testClassname( + @ApiParam(value = "client model" ,required=true) Client body, + @Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testClassname(body,securityContext); + } +} diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java new file mode 100644 index 00000000000..ecf374c3758 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java @@ -0,0 +1,25 @@ +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + +import com.sun.jersey.multipart.FormDataParam; + +import io.swagger.model.Client; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import com.sun.jersey.core.header.FormDataContentDisposition; +import com.sun.jersey.multipart.FormDataParam; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.validation.constraints.*; + +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..a14a22c2484 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 @@ -27,10 +27,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(); @@ -46,7 +46,7 @@ public class PetApi { }) }, 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,7 +54,7 @@ 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 = { @@ -64,7 +64,7 @@ public Response addPet( }) }, 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 +73,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 +84,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 +92,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 +103,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 +111,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 +119,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) @@ -138,9 +138,9 @@ public Response getPetById( }) }, 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,7 +148,7 @@ 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 = { @@ -158,7 +158,7 @@ public Response updatePet( }) }, 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 +168,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..64d351f1658 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 @@ -26,22 +26,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.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,7 +49,7 @@ 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 = { @@ -63,14 +63,14 @@ public Response getInventory( 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 +78,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..47f9b690bc3 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 @@ -26,10 +26,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(); @@ -40,7 +40,7 @@ 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.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 +48,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.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 +61,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.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 +74,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.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 +88,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 +103,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 +118,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.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.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/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeApi.java index bb401a709da..0c25bd033d3 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 @@ -109,8 +109,8 @@ public Response testClientModel( @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, @@ -136,8 +136,8 @@ public Response testEndpointParameters( @Produces({ "*/*" }) @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, @@ -157,7 +157,7 @@ public Response testEnumParameters( @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/PetApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/PetApi.java index c7387bd20d7..366ef50f921 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 @@ -46,7 +46,7 @@ public class PetApi { }) }, 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) @@ -64,7 +64,7 @@ public Response addPet( }) }, 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 +84,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 +103,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 +119,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) @@ -138,9 +138,9 @@ public Response getPetById( }) }, 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) @@ -158,7 +158,7 @@ public Response updatePet( }) }, 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..0bb90ce0b64 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 @@ -40,8 +40,8 @@ public class StoreApi { @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.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) @@ -69,8 +69,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 +84,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..2abccf632f0 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 @@ -40,7 +40,7 @@ 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.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) @@ -53,7 +53,7 @@ public Response createUser( @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.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) @@ -66,7 +66,7 @@ public Response createUsersWithArrayInput( @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.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) @@ -79,8 +79,8 @@ public Response createUsersWithListInput( @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.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 +94,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 +109,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, @@ -123,7 +123,7 @@ public Response loginUser( @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.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 { @@ -135,8 +135,8 @@ public Response logoutUser( @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.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..32baa4c311c 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 @@ -27,10 +27,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 +57,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 +69,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 +81,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 +93,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", }) @@ -124,9 +124,9 @@ public Response testClientModel(@ApiParam(value = "client model" ,required=true) @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 @@ -151,9 +151,9 @@ public Response testEndpointParameters(@ApiParam(value = "None", required=true) @Produces({ "*/*" }) @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 +167,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.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/FakeClassnameTags123Api.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java new file mode 100644 index 00000000000..5f5cd857740 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java @@ -0,0 +1,70 @@ +package io.swagger.api; + +import io.swagger.model.*; +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.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataParam; + +import javax.servlet.ServletConfig; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import javax.validation.constraints.*; + +@Path("/FakeClassnameTags123") + + +@io.swagger.annotations.Api(description = "the FakeClassnameTags123 API") + +public class FakeClassnameTags123Api { + private final FakeClassnameTags123ApiService delegate; + + public FakeClassnameTags123Api(@Context ServletConfig servletContext) { + FakeClassnameTags123ApiService delegate = null; + + if (servletContext != null) { + String implClass = servletContext.getInitParameter("FakeClassnameTags123Api.implementation"); + if (implClass != null && !"".equals(implClass.trim())) { + try { + delegate = (FakeClassnameTags123ApiService) Class.forName(implClass).newInstance(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + } + + if (delegate == null) { + delegate = FakeClassnameTags123ApiServiceFactory.getFakeClassnameTags123Api(); + } + + this.delegate = delegate; + } + + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { + @io.swagger.annotations.Authorization(value = "api_key_query") + }, tags={ "fake_classname_tags 123#$%^", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + public Response testClassname(@ApiParam(value = "client model" ,required=true) Client body +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testClassname(body,securityContext); + } +} diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java new file mode 100644 index 00000000000..65e819f60e2 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java @@ -0,0 +1,21 @@ +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; + +import io.swagger.model.Client; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.validation.constraints.*; + +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..1dce949239c 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 @@ -26,10 +26,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; @@ -66,14 +66,14 @@ public PetApi(@Context ServletConfig servletContext) { }) }, 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 = { @@ -83,7 +83,7 @@ public Response addPet(@ApiParam(value = "Pet object that needs to be added to t }) }, 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 +91,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 +103,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 +122,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 +138,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 { @@ -157,18 +157,18 @@ public Response getPetById(@ApiParam(value = "ID of pet to return",required=true }) }, 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 = { @@ -178,7 +178,7 @@ public Response updatePet(@ApiParam(value = "Pet object that needs to be added t }) }, 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 +187,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..eaa61ac1be6 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 @@ -25,10 +25,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,21 +55,21 @@ 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.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 = { @@ -82,30 +82,30 @@ public Response getInventory(@Context SecurityContext securityContext) 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..1487309e48f 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 @@ -25,10 +25,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; @@ -60,75 +60,75 @@ 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.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.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.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.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 +136,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.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.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/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApi.java index 8935f8b3d79..c4be76c1a85 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 @@ -124,9 +124,9 @@ public Response testClientModel(@ApiParam(value = "client model" ,required=true) @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 @@ -151,9 +151,9 @@ public Response testEndpointParameters(@ApiParam(value = "None", required=true) @Produces({ "*/*" }) @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 @@ -172,7 +172,7 @@ public Response testEnumParameters(@ApiParam(value = "Form parameter enum test ( @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/PetApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/PetApi.java index 30b1eece3c8..18b3b6d4275 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 @@ -66,7 +66,7 @@ public PetApi(@Context ServletConfig servletContext) { }) }, 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 { @@ -83,7 +83,7 @@ public Response addPet(@ApiParam(value = "Pet object that needs to be added to t }) }, 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 +103,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 +122,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 +138,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 { @@ -157,11 +157,11 @@ public Response getPetById(@ApiParam(value = "ID of pet to return",required=true }) }, 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 { @@ -178,7 +178,7 @@ public Response updatePet(@ApiParam(value = "Pet object that needs to be added t }) }, 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..abc8db088bd 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 @@ -60,9 +60,9 @@ public StoreApi(@Context ServletConfig servletContext) { @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.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 { @@ -89,9 +89,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 +105,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..a6dcd214872 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 @@ -60,7 +60,7 @@ 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.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 { @@ -72,7 +72,7 @@ public Response createUser(@ApiParam(value = "Created user object" ,required=tru @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.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 { @@ -84,7 +84,7 @@ public Response createUsersWithArrayInput(@ApiParam(value = "List of user object @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.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 { @@ -96,9 +96,9 @@ public Response createUsersWithListInput(@ApiParam(value = "List of user object" @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.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 +112,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 +128,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) @@ -141,7 +141,7 @@ public Response loginUser(@ApiParam(value = "The user name for login",required=t @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.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); @@ -152,9 +152,9 @@ public Response logoutUser(@Context SecurityContext securityContext) @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.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/undertow/src/main/java/io/swagger/model/Order.java b/samples/server/petstore/undertow/src/main/java/io/swagger/model/Order.java index 3349d631671..fab631a5da6 100644 --- a/samples/server/petstore/undertow/src/main/java/io/swagger/model/Order.java +++ b/samples/server/petstore/undertow/src/main/java/io/swagger/model/Order.java @@ -141,7 +141,7 @@ public Order complete(Boolean complete) { @ApiModelProperty(value = "") @JsonProperty("complete") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } public void setComplete(Boolean complete) { diff --git a/samples/server/petstore/undertow/src/main/resources/config/swagger.json b/samples/server/petstore/undertow/src/main/resources/config/swagger.json index c2d08f8e01f..6cdf4cc1a5a 100644 --- a/samples/server/petstore/undertow/src/main/resources/config/swagger.json +++ b/samples/server/petstore/undertow/src/main/resources/config/swagger.json @@ -173,6 +173,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "deprecated" : true, "x-contentType" : "application/json", "x-accepts" : "application/json" } @@ -724,12 +725,12 @@ "title" : "Pet Order", "description" : "An order for a pets from the pet store", "example" : { - "petId" : 6, - "quantity" : 1, "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", + "petId" : 6, "complete" : false, - "status" : "placed" + "status" : "placed", + "quantity" : 1, + "shipDate" : "2000-01-23T04:56:07.000+00:00" }, "xml" : { "name" : "Order" @@ -749,8 +750,8 @@ "title" : "Pet catehgry", "description" : "A category for a pet", "example" : { - "name" : "aeiou", - "id" : 6 + "id" : 6, + "name" : "name" }, "xml" : { "name" : "Category" @@ -790,14 +791,14 @@ "title" : "a User", "description" : "A User who is purchasing from the pet store", "example" : { - "firstName" : "aeiou", - "lastName" : "aeiou", - "password" : "aeiou", - "userStatus" : 6, - "phone" : "aeiou", "id" : 0, - "email" : "aeiou", - "username" : "aeiou" + "lastName" : "lastName", + "phone" : "phone", + "username" : "username", + "email" : "email", + "userStatus" : 6, + "firstName" : "firstName", + "password" : "password" }, "xml" : { "name" : "User" @@ -817,8 +818,8 @@ "title" : "Pet Tag", "description" : "A tag for a pet", "example" : { - "name" : "aeiou", - "id" : 1 + "id" : 1, + "name" : "name" }, "xml" : { "name" : "Tag" @@ -868,18 +869,21 @@ "title" : "a Pet", "description" : "A pet for sale in the pet store", "example" : { - "photoUrls" : [ "aeiou" ], - "name" : "doggie", + "tags" : [ { + "id" : 1, + "name" : "name" + }, { + "id" : 1, + "name" : "name" + } ], "id" : 0, "category" : { - "name" : "aeiou", - "id" : 6 + "id" : 6, + "name" : "name" }, - "tags" : [ { - "name" : "aeiou", - "id" : 1 - } ], - "status" : "available" + "status" : "available", + "name" : "doggie", + "photoUrls" : [ "photoUrls", "photoUrls" ] }, "xml" : { "name" : "Pet" @@ -902,9 +906,9 @@ "title" : "An uploaded response", "description" : "Describes the result of uploading an image resource", "example" : { + "message" : "message", "code" : 0, - "type" : "aeiou", - "message" : "aeiou" + "type" : "type" } } },