From 00664bcb718863b03d9b161a8c70e291511c2e1c Mon Sep 17 00:00:00 2001 From: "J. Fiala" Date: Fri, 6 Jan 2017 17:35:05 +0100 Subject: [PATCH 01/23] add check for hideGenerationTimestamp #4091 --- .../resources/JavaJaxRS/cxf-cdi/generatedAnnotation.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/generatedAnnotation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/generatedAnnotation.mustache index 49110fc1ad9..a47b6faa85b 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/generatedAnnotation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/generatedAnnotation.mustache @@ -1 +1 @@ -@javax.annotation.Generated(value = "{{generatorClass}}", date = "{{generatedDate}}") \ No newline at end of file +{{^hideGenerationTimestamp}}@javax.annotation.Generated(value = "{{generatorClass}}", date = "{{generatedDate}}"){{/hideGenerationTimestamp}} \ No newline at end of file From 7df73e3867c1b09b00d3f82014bf43613efb52b3 Mon Sep 17 00:00:00 2001 From: "J. Fiala" Date: Fri, 6 Jan 2017 17:37:19 +0100 Subject: [PATCH 02/23] update generated sample with no generated timestamps #4091 --- .../jaxrs-cxf-cdi/.swagger-codegen-ignore | 46 +- samples/server/petstore/jaxrs-cxf-cdi/pom.xml | 162 +- .../src/gen/java/io/swagger/api/PetApi.java | 331 ++-- .../java/io/swagger/api/PetApiService.java | 58 +- .../src/gen/java/io/swagger/api/StoreApi.java | 167 +- .../java/io/swagger/api/StoreApiService.java | 48 +- .../src/gen/java/io/swagger/api/UserApi.java | 253 ++- .../java/io/swagger/api/UserApiService.java | 56 +- .../gen/java/io/swagger/model/Category.java | 191 +- .../io/swagger/model/ModelApiResponse.java | 231 ++- .../src/gen/java/io/swagger/model/Order.java | 387 ++-- .../src/gen/java/io/swagger/model/Pet.java | 395 ++-- .../src/gen/java/io/swagger/model/Tag.java | 191 +- .../src/gen/java/io/swagger/model/User.java | 433 +++-- .../java/io/swagger/api/RestApplication.java | 16 +- .../swagger/api/impl/PetApiServiceImpl.java | 126 +- .../swagger/api/impl/StoreApiServiceImpl.java | 84 +- .../swagger/api/impl/UserApiServiceImpl.java | 124 +- .../src/main/webapp/WEB-INF/beans.xml | 24 +- .../petstore/jaxrs-cxf-cdi/swagger.json | 1660 ++++++++--------- 20 files changed, 2487 insertions(+), 2496 deletions(-) diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen-ignore b/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen-ignore index c5fa491b4c5..f21535fd6e9 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen-ignore +++ b/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen-ignore @@ -1,23 +1,23 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/jaxrs-cxf-cdi/pom.xml b/samples/server/petstore/jaxrs-cxf-cdi/pom.xml index 4534f2961ac..fcd2045b2ff 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-cdi/pom.xml @@ -1,82 +1,82 @@ - - 4.0.0 - io.swagger - swagger-jaxrs-cxf-cdi-server - war - swagger-jaxrs-cxf-cdi-server - 1.0.0 - - - - src/main/java - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.9.1 - - - add-source - generate-sources - - add-source - - - - src/gen/java - - - - - - - - - maven-war-plugin - 3.0.0 - - false - - - - - - - - - - javax - javaee-api - 7.0 - provided - - - - - org.apache.cxf - cxf-rt-frontend-jaxrs - - - 3.0.2 - provided - - - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - [2.8.3,3) - - - - - io.swagger - swagger-annotations - [1.5.3,2) - - - - + + 4.0.0 + io.swagger + swagger-jaxrs-cxf-cdi-server + war + swagger-jaxrs-cxf-cdi-server + 1.0.0 + + + + src/main/java + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + + + maven-war-plugin + 3.0.0 + + false + + + + + + + + + + javax + javaee-api + 7.0 + provided + + + + + org.apache.cxf + cxf-rt-frontend-jaxrs + + + 3.0.2 + provided + + + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + [2.8.3,3) + + + + + io.swagger + swagger-annotations + [1.5.3,2) + + + + \ No newline at end of file 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 df620e58666..bca3172e139 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 @@ -1,166 +1,165 @@ -package io.swagger.api; - -import java.io.File; -import io.swagger.model.ModelApiResponse; -import io.swagger.model.Pet; -import io.swagger.api.PetApiService; - -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; - -import io.swagger.annotations.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.List; - -@Path("/pet") -@RequestScoped - -@Api(description = "the pet API") - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") - -public class PetApi { - - @Context SecurityContext securityContext; - - @Inject PetApiService delegate; - - - @POST - - @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Add a new pet to the store", notes = "", response = void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) - public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { - return delegate.addPet(body, securityContext); - } - - @DELETE - @Path("/{petId}") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Deletes a pet", notes = "", response = void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid pet value", response = void.class) }) - 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); - } - - @GET - @Path("/findByStatus") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) - public Response findPetsByStatus(@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); - } - - @GET - @Path("/findByTags") - - @Produces({ "application/xml", "application/json" }) - @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 = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) - public Response findPetsByTags(@ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags) { - return delegate.findPetsByTags(tags, securityContext); - } - - @GET - @Path("/{petId}") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, 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) }) - public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId) { - return delegate.getPetById(petId, securityContext); - } - - @PUT - - @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Update an existing pet", notes = "", response = void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), - @ApiResponse(code = 404, message = "Pet not found", response = void.class), - @ApiResponse(code = 405, message = "Validation exception", response = void.class) }) - public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { - return delegate.updatePet(body, securityContext); - } - - @POST - @Path("/{petId}") - @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) - 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); - } - - @POST - @Path("/{petId}/uploadImage") - @Consumes({ "multipart/form-data" }) - @Produces({ "application/json" }) - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file", required = false) InputStream fileInputStream, @Multipart(value = "file" , required = false) Attachment fileDetail) { - return delegate.uploadFile(petId, additionalMetadata, inputStream, fileDetail, securityContext); - } -} +package io.swagger.api; + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; +import io.swagger.api.PetApiService; + +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; + +import io.swagger.annotations.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.List; +@Path("/pet") +@RequestScoped + +@Api(description = "the pet API") + + + + +public class PetApi { + + @Context SecurityContext securityContext; + + @Inject PetApiService delegate; + + + @POST + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Add a new pet to the store", notes = "", response = void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { + return delegate.addPet(body, securityContext); + } + + @DELETE + @Path("/{petId}") + + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Deletes a pet", notes = "", response = void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid pet value", response = void.class) }) + 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); + } + + @GET + @Path("/findByStatus") + + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + public Response findPetsByStatus(@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); + } + + @GET + @Path("/findByTags") + + @Produces({ "application/xml", "application/json" }) + @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 = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + public Response findPetsByTags(@ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags) { + return delegate.findPetsByTags(tags, securityContext); + } + + @GET + @Path("/{petId}") + + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @Authorization(value = "api_key") + }, 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) }) + public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId) { + return delegate.getPetById(petId, securityContext); + } + + @PUT + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Update an existing pet", notes = "", response = void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), + @ApiResponse(code = 404, message = "Pet not found", response = void.class), + @ApiResponse(code = 405, message = "Validation exception", response = void.class) }) + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { + return delegate.updatePet(body, securityContext); + } + + @POST + @Path("/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + 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); + } + + @POST + @Path("/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file", required = false) InputStream fileInputStream, @Multipart(value = "file" , required = false) Attachment fileDetail) { + return delegate.uploadFile(petId, additionalMetadata, inputStream, fileDetail, securityContext); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java index 924bf6ea7da..0ed0a9da2ce 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java @@ -1,29 +1,29 @@ -package io.swagger.api; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.io.File; -import io.swagger.model.ModelApiResponse; -import io.swagger.model.Pet; - -import java.util.List; - -import java.io.InputStream; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") -public interface PetApiService { - public Response addPet(Pet body, SecurityContext securityContext); - public Response deletePet(Long petId, String apiKey, SecurityContext securityContext); - public Response findPetsByStatus(List status, SecurityContext securityContext); - public Response findPetsByTags(List tags, SecurityContext securityContext); - public Response getPetById(Long petId, SecurityContext securityContext); - public Response updatePet(Pet body, SecurityContext securityContext); - public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext); - public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, Attachment fileDetail, SecurityContext securityContext); -} +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public interface PetApiService { + public Response addPet(Pet body, SecurityContext securityContext); + public Response deletePet(Long petId, String apiKey, SecurityContext securityContext); + public Response findPetsByStatus(List status, SecurityContext securityContext); + public Response findPetsByTags(List tags, SecurityContext securityContext); + public Response getPetById(Long petId, SecurityContext securityContext); + public Response updatePet(Pet body, SecurityContext securityContext); + public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext); + public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, Attachment fileDetail, SecurityContext 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 9531172123c..d84cd657303 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 @@ -1,84 +1,83 @@ -package io.swagger.api; - -import java.util.Map; -import io.swagger.model.Order; -import io.swagger.api.StoreApiService; - -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; - -import io.swagger.annotations.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.List; - -@Path("/store") -@RequestScoped - -@Api(description = "the store API") - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") - -public class StoreApi { - - @Context SecurityContext securityContext; - - @Inject StoreApiService delegate; - - - @DELETE - @Path("/order/{orderId}") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = void.class, tags={ "store", }) - @ApiResponses(value = { - @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); - } - - @GET - @Path("/inventory") - - @Produces({ "application/json" }) - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { - @Authorization(value = "api_key") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) - public Response getInventory() { - return delegate.getInventory(securityContext); - } - - @GET - @Path("/order/{orderId}") - - @Produces({ "application/xml", "application/json" }) - @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) }) - public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") Long orderId) { - return delegate.getOrderById(orderId, securityContext); - } - - @POST - @Path("/order") - - @Produces({ "application/xml", "application/json" }) - @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) }) - public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body) { - return delegate.placeOrder(body, securityContext); - } -} +package io.swagger.api; + +import java.util.Map; +import io.swagger.model.Order; +import io.swagger.api.StoreApiService; + +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; + +import io.swagger.annotations.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.List; +@Path("/store") +@RequestScoped + +@Api(description = "the store API") + + + + +public class StoreApi { + + @Context SecurityContext securityContext; + + @Inject StoreApiService delegate; + + + @DELETE + @Path("/order/{orderId}") + + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = void.class, tags={ "store", }) + @ApiResponses(value = { + @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); + } + + @GET + @Path("/inventory") + + @Produces({ "application/json" }) + @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @Authorization(value = "api_key") + }, tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + public Response getInventory() { + return delegate.getInventory(securityContext); + } + + @GET + @Path("/order/{orderId}") + + @Produces({ "application/xml", "application/json" }) + @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) }) + public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") Long orderId) { + return delegate.getOrderById(orderId, securityContext); + } + + @POST + @Path("/order") + + @Produces({ "application/xml", "application/json" }) + @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) }) + 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/StoreApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java index 3ea40b6fbc1..962f3e16965 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java @@ -1,24 +1,24 @@ -package io.swagger.api; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.Map; -import io.swagger.model.Order; - -import java.util.List; - -import java.io.InputStream; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") -public interface StoreApiService { - public Response deleteOrder(String orderId, SecurityContext securityContext); - public Response getInventory(SecurityContext securityContext); - public Response getOrderById(Long orderId, SecurityContext securityContext); - public Response placeOrder(Order body, SecurityContext securityContext); -} +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public interface StoreApiService { + public Response deleteOrder(String orderId, SecurityContext securityContext); + public Response getInventory(SecurityContext securityContext); + public Response getOrderById(Long orderId, SecurityContext securityContext); + public Response placeOrder(Order body, SecurityContext 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 cc052a69955..98394e3b82e 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 @@ -1,127 +1,126 @@ -package io.swagger.api; - -import java.util.List; -import io.swagger.model.User; -import io.swagger.api.UserApiService; - -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; - -import io.swagger.annotations.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.List; - -@Path("/user") -@RequestScoped - -@Api(description = "the user API") - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") - -public class UserApi { - - @Context SecurityContext securityContext; - - @Inject UserApiService delegate; - - - @POST - - - @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) }) - public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body) { - return delegate.createUser(body, securityContext); - } - - @POST - @Path("/createWithArray") - - @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) }) - public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body) { - return delegate.createUsersWithArrayInput(body, securityContext); - } - - @POST - @Path("/createWithList") - - @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) }) - public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body) { - return delegate.createUsersWithListInput(body, securityContext); - } - - @DELETE - @Path("/{username}") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) - @ApiResponses(value = { - @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); - } - - @GET - @Path("/{username}") - - @Produces({ "application/xml", "application/json" }) - @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) }) - 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); - } - - @GET - @Path("/login") - - @Produces({ "application/xml", "application/json" }) - @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) }) - 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) { - return delegate.loginUser(username, password, securityContext); - } - - @GET - @Path("/logout") - - @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) }) - public Response logoutUser() { - return delegate.logoutUser(securityContext); - } - - @PUT - @Path("/{username}") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user" }) - @ApiResponses(value = { - @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); - } -} +package io.swagger.api; + +import java.util.List; +import io.swagger.model.User; +import io.swagger.api.UserApiService; + +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; + +import io.swagger.annotations.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.List; +@Path("/user") +@RequestScoped + +@Api(description = "the user API") + + + + +public class UserApi { + + @Context SecurityContext securityContext; + + @Inject UserApiService delegate; + + + @POST + + + @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) }) + public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body) { + return delegate.createUser(body, securityContext); + } + + @POST + @Path("/createWithArray") + + @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) }) + public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body) { + return delegate.createUsersWithArrayInput(body, securityContext); + } + + @POST + @Path("/createWithList") + + @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) }) + public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body) { + return delegate.createUsersWithListInput(body, securityContext); + } + + @DELETE + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) + @ApiResponses(value = { + @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); + } + + @GET + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @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) }) + 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); + } + + @GET + @Path("/login") + + @Produces({ "application/xml", "application/json" }) + @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) }) + 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) { + return delegate.loginUser(username, password, securityContext); + } + + @GET + @Path("/logout") + + @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) }) + public Response logoutUser() { + return delegate.logoutUser(securityContext); + } + + @PUT + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user" }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied", response = void.class), + @ApiResponse(code = 404, message = "User not found", response = void.class) }) + public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username, @ApiParam(value = "Updated user object" ,required=true) User body) { + return delegate.updateUser(username, body, securityContext); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java index 14187d1302f..922b7ac3021 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java @@ -1,28 +1,28 @@ -package io.swagger.api; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.List; -import io.swagger.model.User; - -import java.util.List; - -import java.io.InputStream; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") -public interface UserApiService { - public Response createUser(User body, SecurityContext securityContext); - public Response createUsersWithArrayInput(List body, SecurityContext securityContext); - public Response createUsersWithListInput(List body, SecurityContext securityContext); - public Response deleteUser(String username, SecurityContext securityContext); - public Response getUserByName(String username, SecurityContext securityContext); - public Response loginUser(String username, String password, SecurityContext securityContext); - public Response logoutUser(SecurityContext securityContext); - public Response updateUser(String username, User body, SecurityContext securityContext); -} +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.List; +import io.swagger.model.User; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public interface UserApiService { + public Response createUser(User body, SecurityContext securityContext); + public Response createUsersWithArrayInput(List body, SecurityContext securityContext); + public Response createUsersWithListInput(List body, SecurityContext securityContext); + public Response deleteUser(String username, SecurityContext securityContext); + public Response getUserByName(String username, SecurityContext securityContext); + public Response loginUser(String username, String password, SecurityContext securityContext); + public Response logoutUser(SecurityContext securityContext); + public Response updateUser(String username, User body, SecurityContext securityContext); +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java index 79ba2971c54..5c941a3a15b 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java @@ -1,96 +1,95 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; - - -/** - * A category for a pet - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "A category for a pet") - -public class Category { - - private Long id = null; - private String name = null; - - /** - **/ - public Category id(Long id) { - this.id = id; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - public Category name(String name) { - this.name = name; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(id, category.id) && - Objects.equals(name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; + +/** + * A category for a pet + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "A category for a pet") + +public class Category { + + private Long id = null; + private String name = null; + + /** + **/ + public Category id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Category name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(id, category.id) && + Objects.equals(name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java index a42de8ae1e1..1424e1d4d37 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -1,116 +1,115 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; - - -/** - * Describes the result of uploading an image resource - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "Describes the result of uploading an image resource") - -public class ModelApiResponse { - - private Integer code = null; - private String type = null; - private String message = null; - - /** - **/ - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("code") - public Integer getCode() { - return code; - } - public void setCode(Integer code) { - this.code = code; - } - - /** - **/ - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("type") - public String getType() { - return type; - } - public void setType(String type) { - this.type = type; - } - - /** - **/ - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("message") - public String getMessage() { - return message; - } - public void setMessage(String message) { - this.message = message; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(code, _apiResponse.code) && - Objects.equals(type, _apiResponse.type) && - Objects.equals(message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; + +/** + * Describes the result of uploading an image resource + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "Describes the result of uploading an image resource") + +public class ModelApiResponse { + + private Integer code = null; + private String type = null; + private String message = null; + + /** + **/ + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("code") + public Integer getCode() { + return code; + } + public void setCode(Integer code) { + this.code = code; + } + + /** + **/ + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("type") + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + /** + **/ + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("message") + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(code, _apiResponse.code) && + Objects.equals(type, _apiResponse.type) && + Objects.equals(message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java index d1fd9f10f03..450d8606bf4 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java @@ -1,194 +1,193 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; - - -/** - * An order for a pets from the pet store - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "An order for a pets from the pet store") - -public class Order { - - private Long id = null; - private Long petId = null; - private Integer quantity = null; - private java.util.Date shipDate = null; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name="Order") -@XmlEnum -public enum Order { - {values=[placed, approved, delivered], enumVars=[{name=PLACED, value="placed"}, {name=APPROVED, value="approved"}, {name=DELIVERED, value="delivered"}]}, - - public String value() { - return name(); - } - - public static Order fromValue(String v) { - return valueOf(v); - } -} - private StatusEnum status = null; - private Boolean complete = false; - - /** - **/ - public Order id(Long id) { - this.id = id; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("petId") - public Long getPetId() { - return petId; - } - public void setPetId(Long petId) { - this.petId = petId; - } - - /** - **/ - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("quantity") - public Integer getQuantity() { - return quantity; - } - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - /** - **/ - public Order shipDate(java.util.Date shipDate) { - this.shipDate = shipDate; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("shipDate") - public java.util.Date getShipDate() { - return shipDate; - } - public void setShipDate(java.util.Date shipDate) { - this.shipDate = shipDate; - } - - /** - * Order Status - **/ - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - - @ApiModelProperty(example = "null", value = "Order Status") - @JsonProperty("status") - public StatusEnum getStatus() { - return status; - } - public void setStatus(StatusEnum status) { - this.status = status; - } - - /** - **/ - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("complete") - public Boolean getComplete() { - return complete; - } - public void setComplete(Boolean complete) { - this.complete = complete; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(id, order.id) && - Objects.equals(petId, order.petId) && - Objects.equals(quantity, order.quantity) && - Objects.equals(shipDate, order.shipDate) && - Objects.equals(status, order.status) && - Objects.equals(complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; + +/** + * An order for a pets from the pet store + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "An order for a pets from the pet store") + +public class Order { + + private Long id = null; + private Long petId = null; + private Integer quantity = null; + private java.util.Date shipDate = null; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="Order") +@XmlEnum +public enum Order { + {values=[placed, approved, delivered], enumVars=[{name=PLACED, value="placed"}, {name=APPROVED, value="approved"}, {name=DELIVERED, value="delivered"}]}, + + public String value() { + return name(); + } + + public static Order fromValue(String v) { + return valueOf(v); + } +} + private StatusEnum status = null; + private Boolean complete = false; + + /** + **/ + public Order id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + public void setPetId(Long petId) { + this.petId = petId; + } + + /** + **/ + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + /** + **/ + public Order shipDate(java.util.Date shipDate) { + this.shipDate = shipDate; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("shipDate") + public java.util.Date getShipDate() { + return shipDate; + } + public void setShipDate(java.util.Date shipDate) { + this.shipDate = shipDate; + } + + /** + * Order Status + **/ + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + + @ApiModelProperty(example = "null", value = "Order Status") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + **/ + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("complete") + public Boolean getComplete() { + return complete; + } + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(id, order.id) && + Objects.equals(petId, order.petId) && + Objects.equals(quantity, order.quantity) && + Objects.equals(shipDate, order.shipDate) && + Objects.equals(status, order.status) && + Objects.equals(complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java index ebbe32b810f..357b3f0e23c 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java @@ -1,198 +1,197 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.model.Category; -import io.swagger.model.Tag; -import java.util.ArrayList; -import java.util.List; - - -/** - * A pet for sale in the pet store - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "A pet for sale in the pet store") - -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(); - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name="Pet") -@XmlEnum -public enum Pet { - {values=[available, pending, sold], enumVars=[{name=AVAILABLE, value="available"}, {name=PENDING, value="pending"}, {name=SOLD, value="sold"}]}, - - public String value() { - return name(); - } - - public static Pet fromValue(String v) { - return valueOf(v); - } -} - private StatusEnum status = null; - - /** - **/ - public Pet id(Long id) { - this.id = id; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - public Pet category(Category category) { - this.category = category; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("category") - public Category getCategory() { - return category; - } - public void setCategory(Category category) { - this.category = category; - } - - /** - **/ - public Pet name(String name) { - this.name = name; - return this; - } - - - @ApiModelProperty(example = "doggie", required = true, value = "") - @JsonProperty("name") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - /** - **/ - public Pet photoUrls(List photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - - @ApiModelProperty(example = "null", required = true, value = "") - @JsonProperty("photoUrls") - public List getPhotoUrls() { - return photoUrls; - } - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } - - /** - **/ - public Pet tags(List tags) { - this.tags = tags; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("tags") - public List getTags() { - return tags; - } - public void setTags(List tags) { - this.tags = tags; - } - - /** - * pet status in the store - **/ - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - - @ApiModelProperty(example = "null", value = "pet status in the store") - @JsonProperty("status") - public StatusEnum getStatus() { - return status; - } - public void setStatus(StatusEnum status) { - this.status = status; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(id, pet.id) && - Objects.equals(category, pet.category) && - Objects.equals(name, pet.name) && - Objects.equals(photoUrls, pet.photoUrls) && - Objects.equals(tags, pet.tags) && - Objects.equals(status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.model.Category; +import io.swagger.model.Tag; +import java.util.ArrayList; +import java.util.List; + +/** + * A pet for sale in the pet store + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "A pet for sale in the pet store") + +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(); + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="Pet") +@XmlEnum +public enum Pet { + {values=[available, pending, sold], enumVars=[{name=AVAILABLE, value="available"}, {name=PENDING, value="pending"}, {name=SOLD, value="sold"}]}, + + public String value() { + return name(); + } + + public static Pet fromValue(String v) { + return valueOf(v); + } +} + private StatusEnum status = null; + + /** + **/ + public Pet id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Pet category(Category category) { + this.category = category; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("category") + public Category getCategory() { + return category; + } + public void setCategory(Category category) { + this.category = category; + } + + /** + **/ + public Pet name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + /** + **/ + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("photoUrls") + public List getPhotoUrls() { + return photoUrls; + } + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + /** + **/ + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("tags") + public List getTags() { + return tags; + } + public void setTags(List tags) { + this.tags = tags; + } + + /** + * pet status in the store + **/ + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + + @ApiModelProperty(example = "null", value = "pet status in the store") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(id, pet.id) && + Objects.equals(category, pet.category) && + Objects.equals(name, pet.name) && + Objects.equals(photoUrls, pet.photoUrls) && + Objects.equals(tags, pet.tags) && + Objects.equals(status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java index dc277dedce7..78b9a6b0a5b 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java @@ -1,96 +1,95 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; - - -/** - * A tag for a pet - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "A tag for a pet") - -public class Tag { - - private Long id = null; - private String name = null; - - /** - **/ - public Tag id(Long id) { - this.id = id; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - public Tag name(String name) { - this.name = name; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(id, tag.id) && - Objects.equals(name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; + +/** + * A tag for a pet + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "A tag for a pet") + +public class Tag { + + private Long id = null; + private String name = null; + + /** + **/ + public Tag id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Tag name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(id, tag.id) && + Objects.equals(name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java index 0cc5cae6d6e..62b05c0cd43 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java @@ -1,217 +1,216 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; - - -/** - * A User who is purchasing from the pet store - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "A User who is purchasing from the pet store") - -public class User { - - private Long id = null; - private String username = null; - private String firstName = null; - private String lastName = null; - private String email = null; - private String password = null; - private String phone = null; - private Integer userStatus = null; - - /** - **/ - public User id(Long id) { - this.id = id; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - public User username(String username) { - this.username = username; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("username") - public String getUsername() { - return username; - } - public void setUsername(String username) { - this.username = username; - } - - /** - **/ - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("firstName") - public String getFirstName() { - return firstName; - } - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - /** - **/ - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("lastName") - public String getLastName() { - return lastName; - } - public void setLastName(String lastName) { - this.lastName = lastName; - } - - /** - **/ - public User email(String email) { - this.email = email; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("email") - public String getEmail() { - return email; - } - public void setEmail(String email) { - this.email = email; - } - - /** - **/ - public User password(String password) { - this.password = password; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("password") - public String getPassword() { - return password; - } - public void setPassword(String password) { - this.password = password; - } - - /** - **/ - public User phone(String phone) { - this.phone = phone; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("phone") - public String getPhone() { - return phone; - } - public void setPhone(String phone) { - this.phone = phone; - } - - /** - * User Status - **/ - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - - @ApiModelProperty(example = "null", value = "User Status") - @JsonProperty("userStatus") - public Integer getUserStatus() { - return userStatus; - } - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(id, user.id) && - Objects.equals(username, user.username) && - Objects.equals(firstName, user.firstName) && - Objects.equals(lastName, user.lastName) && - Objects.equals(email, user.email) && - Objects.equals(password, user.password) && - Objects.equals(phone, user.phone) && - Objects.equals(userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; + +/** + * A User who is purchasing from the pet store + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "A User who is purchasing from the pet store") + +public class User { + + private Long id = null; + private String username = null; + private String firstName = null; + private String lastName = null; + private String email = null; + private String password = null; + private String phone = null; + private Integer userStatus = null; + + /** + **/ + public User id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public User username(String username) { + this.username = username; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("username") + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + /** + **/ + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + **/ + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + **/ + public User email(String email) { + this.email = email; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("email") + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + /** + **/ + public User password(String password) { + this.password = password; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("password") + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + /** + **/ + public User phone(String phone) { + this.phone = phone; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("phone") + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + + /** + * User Status + **/ + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + + @ApiModelProperty(example = "null", value = "User Status") + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(id, user.id) && + Objects.equals(username, user.username) && + Objects.equals(firstName, user.firstName) && + Objects.equals(lastName, user.lastName) && + Objects.equals(email, user.email) && + Objects.equals(password, user.password) && + Objects.equals(phone, user.phone) && + Objects.equals(userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/RestApplication.java index 1ae54938776..3b43beeb9be 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/RestApplication.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/RestApplication.java @@ -1,9 +1,9 @@ -package io.swagger.api; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -@ApplicationPath("/") -public class RestApplication extends Application { - // Add implementation-specific details here +package io.swagger.api; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +@ApplicationPath("/") +public class RestApplication extends Application { + // Add implementation-specific details here } \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index 3a03e87fc7d..171bdabcb05 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -1,63 +1,63 @@ -package io.swagger.api.impl; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.io.File; -import io.swagger.model.ModelApiResponse; -import io.swagger.model.Pet; - -import java.util.List; - -import java.io.InputStream; - -import javax.enterprise.context.RequestScoped; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@RequestScoped -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") -public class PetApiServiceImpl implements PetApiService { - @Override - public Response addPet(Pet body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response deletePet(Long petId, String apiKey, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response findPetsByStatus(List status, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response findPetsByTags(List tags, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response getPetById(Long petId, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response updatePet(Pet body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, Attachment fileDetail, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } -} +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import java.util.List; + +import java.io.InputStream; + +import javax.enterprise.context.RequestScoped; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@RequestScoped + +public class PetApiServiceImpl implements PetApiService { + @Override + public Response addPet(Pet body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response deletePet(Long petId, String apiKey, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response findPetsByStatus(List status, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response findPetsByTags(List tags, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response getPetById(Long petId, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response updatePet(Pet body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, Attachment fileDetail, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index fed0fa6c0f0..9463e955569 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -1,42 +1,42 @@ -package io.swagger.api.impl; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.Map; -import io.swagger.model.Order; - -import java.util.List; - -import java.io.InputStream; - -import javax.enterprise.context.RequestScoped; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@RequestScoped -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") -public class StoreApiServiceImpl implements StoreApiService { - @Override - public Response deleteOrder(String orderId, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response getInventory(SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response getOrderById(Long orderId, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response placeOrder(Order body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } -} +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; + +import java.io.InputStream; + +import javax.enterprise.context.RequestScoped; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@RequestScoped + +public class StoreApiServiceImpl implements StoreApiService { + @Override + public Response deleteOrder(String orderId, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response getInventory(SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response getOrderById(Long orderId, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response placeOrder(Order body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index 4f4b3db2382..ab011633fe3 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -1,62 +1,62 @@ -package io.swagger.api.impl; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.List; -import io.swagger.model.User; - -import java.util.List; - -import java.io.InputStream; - -import javax.enterprise.context.RequestScoped; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@RequestScoped -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") -public class UserApiServiceImpl implements UserApiService { - @Override - public Response createUser(User body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response createUsersWithArrayInput(List body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response createUsersWithListInput(List body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response deleteUser(String username, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response getUserByName(String username, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response loginUser(String username, String password, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response logoutUser(SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response updateUser(String username, User body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } -} +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.List; +import io.swagger.model.User; + +import java.util.List; + +import java.io.InputStream; + +import javax.enterprise.context.RequestScoped; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@RequestScoped + +public class UserApiServiceImpl implements UserApiService { + @Override + public Response createUser(User body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response createUsersWithArrayInput(List body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response createUsersWithListInput(List body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response deleteUser(String username, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response getUserByName(String username, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response loginUser(String username, String password, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response logoutUser(SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response updateUser(String username, User body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/webapp/WEB-INF/beans.xml b/samples/server/petstore/jaxrs-cxf-cdi/src/main/webapp/WEB-INF/beans.xml index cb6d500d43f..f9f7d3d948b 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/webapp/WEB-INF/beans.xml +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/webapp/WEB-INF/beans.xml @@ -1,13 +1,13 @@ - - - - - + + + + + \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json index f48e38d5cb2..a3adac3d4ac 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json +++ b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json @@ -1,831 +1,831 @@ -{ - "swagger" : "2.0", - "info" : { - "description" : "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", - "version" : "1.0.0", - "title" : "Swagger Petstore", - "termsOfService" : "http://swagger.io/terms/", - "contact" : { - "email" : "apiteam@swagger.io" - }, - "license" : { - "name" : "Apache 2.0", - "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" - } - }, - "host" : "petstore.swagger.io", - "basePath" : "/v2", - "tags" : [ { - "name" : "pet", - "description" : "Everything about your Pets", - "externalDocs" : { - "description" : "Find out more", - "url" : "http://swagger.io" - } - }, { - "name" : "store", - "description" : "Access to Petstore orders" - }, { - "name" : "user", - "description" : "Operations about user", - "externalDocs" : { - "description" : "Find out more about our store", - "url" : "http://swagger.io" - } - } ], - "schemes" : [ "http" ], - "paths" : { - "/pet" : { - "post" : { - "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "description" : "", - "operationId" : "addPet", - "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Pet object that needs to be added to the store", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Pet" - } - } ], - "responses" : { - "405" : { - "description" : "Invalid input" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - }, - "put" : { - "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "description" : "", - "operationId" : "updatePet", - "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Pet object that needs to be added to the store", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Pet" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" - }, - "405" : { - "description" : "Validation exception" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - } - }, - "/pet/findByStatus" : { - "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by status", - "description" : "Multiple status values can be provided with comma separated strings", - "operationId" : "findPetsByStatus", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "status", - "in" : "query", - "description" : "Status values that need to be considered for filter", - "required" : true, - "type" : "array", - "items" : { - "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] - }, - "collectionFormat" : "csv" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" - } - } - }, - "400" : { - "description" : "Invalid status value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - } - }, - "/pet/findByTags" : { - "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by tags", - "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - "operationId" : "findPetsByTags", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "tags", - "in" : "query", - "description" : "Tags to filter by", - "required" : true, - "type" : "array", - "items" : { - "type" : "string" - }, - "collectionFormat" : "csv" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" - } - } - }, - "400" : { - "description" : "Invalid tag value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - } - }, - "/pet/{petId}" : { - "get" : { - "tags" : [ "pet" ], - "summary" : "Find pet by ID", - "description" : "Returns a single pet", - "operationId" : "getPetById", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "petId", - "in" : "path", - "description" : "ID of pet to return", - "required" : true, - "type" : "integer", - "format" : "int64" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Pet" - } - }, - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" - } - }, - "security" : [ { - "api_key" : [ ] - } ] - }, - "post" : { - "tags" : [ "pet" ], - "summary" : "Updates a pet in the store with form data", - "description" : "", - "operationId" : "updatePetWithForm", - "consumes" : [ "application/x-www-form-urlencoded" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "petId", - "in" : "path", - "description" : "ID of pet that needs to be updated", - "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "name", - "in" : "formData", - "description" : "Updated name of the pet", - "required" : false, - "type" : "string" - }, { - "name" : "status", - "in" : "formData", - "description" : "Updated status of the pet", - "required" : false, - "type" : "string" - } ], - "responses" : { - "405" : { - "description" : "Invalid input" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - }, - "delete" : { - "tags" : [ "pet" ], - "summary" : "Deletes a pet", - "description" : "", - "operationId" : "deletePet", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "api_key", - "in" : "header", - "required" : false, - "type" : "string" - }, { - "name" : "petId", - "in" : "path", - "description" : "Pet id to delete", - "required" : true, - "type" : "integer", - "format" : "int64" - } ], - "responses" : { - "400" : { - "description" : "Invalid pet value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - } - }, - "/pet/{petId}/uploadImage" : { - "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image", - "description" : "", - "operationId" : "uploadFile", - "consumes" : [ "multipart/form-data" ], - "produces" : [ "application/json" ], - "parameters" : [ { - "name" : "petId", - "in" : "path", - "description" : "ID of pet to update", - "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "additionalMetadata", - "in" : "formData", - "description" : "Additional data to pass to server", - "required" : false, - "type" : "string" - }, { - "name" : "file", - "in" : "formData", - "description" : "file to upload", - "required" : false, - "type" : "file" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/ApiResponse" - } - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - } - }, - "/store/inventory" : { - "get" : { - "tags" : [ "store" ], - "summary" : "Returns pet inventories by status", - "description" : "Returns a map of status codes to quantities", - "operationId" : "getInventory", - "produces" : [ "application/json" ], - "parameters" : [ ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "object", - "additionalProperties" : { - "type" : "integer", - "format" : "int32" - } - } - } - }, - "security" : [ { - "api_key" : [ ] - } ] - } - }, - "/store/order" : { - "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", - "description" : "", - "operationId" : "placeOrder", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "order placed for purchasing the pet", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Order" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" - } - }, - "400" : { - "description" : "Invalid Order" - } - } - } - }, - "/store/order/{orderId}" : { - "get" : { - "tags" : [ "store" ], - "summary" : "Find purchase order by ID", - "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - "operationId" : "getOrderById", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "orderId", - "in" : "path", - "description" : "ID of pet that needs to be fetched", - "required" : true, - "type" : "integer", - "maximum" : 5.0, - "minimum" : 1.0, - "format" : "int64" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" - } - }, - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Order not found" - } - } - }, - "delete" : { - "tags" : [ "store" ], - "summary" : "Delete purchase order by ID", - "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", - "operationId" : "deleteOrder", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "orderId", - "in" : "path", - "description" : "ID of the order that needs to be deleted", - "required" : true, - "type" : "string", - "minimum" : 1.0 - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Order not found" - } - } - } - }, - "/user" : { - "post" : { - "tags" : [ "user" ], - "summary" : "Create user", - "description" : "This can only be done by the logged in user.", - "operationId" : "createUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Created user object", - "required" : true, - "schema" : { - "$ref" : "#/definitions/User" - } - } ], - "responses" : { - "default" : { - "description" : "successful operation" - } - } - } - }, - "/user/createWithArray" : { - "post" : { - "tags" : [ "user" ], - "summary" : "Creates list of users with given input array", - "description" : "", - "operationId" : "createUsersWithArrayInput", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "List of user object", - "required" : true, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/User" - } - } - } ], - "responses" : { - "default" : { - "description" : "successful operation" - } - } - } - }, - "/user/createWithList" : { - "post" : { - "tags" : [ "user" ], - "summary" : "Creates list of users with given input array", - "description" : "", - "operationId" : "createUsersWithListInput", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "List of user object", - "required" : true, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/User" - } - } - } ], - "responses" : { - "default" : { - "description" : "successful operation" - } - } - } - }, - "/user/login" : { - "get" : { - "tags" : [ "user" ], - "summary" : "Logs user into the system", - "description" : "", - "operationId" : "loginUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "query", - "description" : "The user name for login", - "required" : true, - "type" : "string" - }, { - "name" : "password", - "in" : "query", - "description" : "The password for login in clear text", - "required" : true, - "type" : "string" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "string" - }, - "headers" : { - "X-Rate-Limit" : { - "type" : "integer", - "format" : "int32", - "description" : "calls per hour allowed by the user" - }, - "X-Expires-After" : { - "type" : "string", - "format" : "date-time", - "description" : "date in UTC when toekn expires" - } - } - }, - "400" : { - "description" : "Invalid username/password supplied" - } - } - } - }, - "/user/logout" : { - "get" : { - "tags" : [ "user" ], - "summary" : "Logs out current logged in user session", - "description" : "", - "operationId" : "logoutUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ ], - "responses" : { - "default" : { - "description" : "successful operation" - } - } - } - }, - "/user/{username}" : { - "get" : { - "tags" : [ "user" ], - "summary" : "Get user by user name", - "description" : "", - "operationId" : "getUserByName", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "The name that needs to be fetched. Use user1 for testing. ", - "required" : true, - "type" : "string" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/User" - } - }, - "400" : { - "description" : "Invalid username supplied" - }, - "404" : { - "description" : "User not found" - } - } - }, - "put" : { - "tags" : [ "user" ], - "summary" : "Updated user", - "description" : "This can only be done by the logged in user.", - "operationId" : "updateUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "name that need to be deleted", - "required" : true, - "type" : "string" - }, { - "in" : "body", - "name" : "body", - "description" : "Updated user object", - "required" : true, - "schema" : { - "$ref" : "#/definitions/User" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid user supplied" - }, - "404" : { - "description" : "User not found" - } - } - }, - "delete" : { - "tags" : [ "user" ], - "summary" : "Delete user", - "description" : "This can only be done by the logged in user.", - "operationId" : "deleteUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "The name that needs to be deleted", - "required" : true, - "type" : "string" - } ], - "responses" : { - "400" : { - "description" : "Invalid username supplied" - }, - "404" : { - "description" : "User not found" - } - } - } - } - }, - "securityDefinitions" : { - "petstore_auth" : { - "type" : "oauth2", - "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", - "flow" : "implicit", - "scopes" : { - "write:pets" : "modify pets in your account", - "read:pets" : "read your pets" - } - }, - "api_key" : { - "type" : "apiKey", - "name" : "api_key", - "in" : "header" - } - }, - "definitions" : { - "Order" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "petId" : { - "type" : "integer", - "format" : "int64" - }, - "quantity" : { - "type" : "integer", - "format" : "int32" - }, - "shipDate" : { - "type" : "string", - "format" : "date-time" - }, - "status" : { - "type" : "string", - "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] - }, - "complete" : { - "type" : "boolean", - "default" : false - } - }, - "title" : "Pet Order", - "description" : "An order for a pets from the pet store", - "xml" : { - "name" : "Order" - } - }, - "Category" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - } - }, - "title" : "Pet catehgry", - "description" : "A category for a pet", - "xml" : { - "name" : "Category" - } - }, - "User" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "username" : { - "type" : "string" - }, - "firstName" : { - "type" : "string" - }, - "lastName" : { - "type" : "string" - }, - "email" : { - "type" : "string" - }, - "password" : { - "type" : "string" - }, - "phone" : { - "type" : "string" - }, - "userStatus" : { - "type" : "integer", - "format" : "int32", - "description" : "User Status" - } - }, - "title" : "a User", - "description" : "A User who is purchasing from the pet store", - "xml" : { - "name" : "User" - } - }, - "Tag" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - } - }, - "title" : "Pet Tag", - "description" : "A tag for a pet", - "xml" : { - "name" : "Tag" - } - }, - "Pet" : { - "type" : "object", - "required" : [ "name", "photoUrls" ], - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "category" : { - "$ref" : "#/definitions/Category" - }, - "name" : { - "type" : "string", - "example" : "doggie" - }, - "photoUrls" : { - "type" : "array", - "xml" : { - "name" : "photoUrl", - "wrapped" : true - }, - "items" : { - "type" : "string" - } - }, - "tags" : { - "type" : "array", - "xml" : { - "name" : "tag", - "wrapped" : true - }, - "items" : { - "$ref" : "#/definitions/Tag" - } - }, - "status" : { - "type" : "string", - "description" : "pet status in the store", - "enum" : [ "available", "pending", "sold" ] - } - }, - "title" : "a Pet", - "description" : "A pet for sale in the pet store", - "xml" : { - "name" : "Pet" - } - }, - "ApiResponse" : { - "type" : "object", - "properties" : { - "code" : { - "type" : "integer", - "format" : "int32" - }, - "type" : { - "type" : "string" - }, - "message" : { - "type" : "string" - } - }, - "title" : "An uploaded response", - "description" : "Describes the result of uploading an image resource" - } - }, - "externalDocs" : { - "description" : "Find out more about Swagger", - "url" : "http://swagger.io" - } +{ + "swagger" : "2.0", + "info" : { + "description" : "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "version" : "1.0.0", + "title" : "Swagger Petstore", + "termsOfService" : "http://swagger.io/terms/", + "contact" : { + "email" : "apiteam@swagger.io" + }, + "license" : { + "name" : "Apache 2.0", + "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "host" : "petstore.swagger.io", + "basePath" : "/v2", + "tags" : [ { + "name" : "pet", + "description" : "Everything about your Pets", + "externalDocs" : { + "description" : "Find out more", + "url" : "http://swagger.io" + } + }, { + "name" : "store", + "description" : "Access to Petstore orders" + }, { + "name" : "user", + "description" : "Operations about user", + "externalDocs" : { + "description" : "Find out more about our store", + "url" : "http://swagger.io" + } + } ], + "schemes" : [ "http" ], + "paths" : { + "/pet" : { + "post" : { + "tags" : [ "pet" ], + "summary" : "Add a new pet to the store", + "description" : "", + "operationId" : "addPet", + "consumes" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Pet object that needs to be added to the store", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Pet" + } + } ], + "responses" : { + "405" : { + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + }, + "put" : { + "tags" : [ "pet" ], + "summary" : "Update an existing pet", + "description" : "", + "operationId" : "updatePet", + "consumes" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Pet object that needs to be added to the store", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Pet" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Pet not found" + }, + "405" : { + "description" : "Validation exception" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/pet/findByStatus" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Finds Pets by status", + "description" : "Multiple status values can be provided with comma separated strings", + "operationId" : "findPetsByStatus", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "status", + "in" : "query", + "description" : "Status values that need to be considered for filter", + "required" : true, + "type" : "array", + "items" : { + "type" : "string", + "default" : "available", + "enum" : [ "available", "pending", "sold" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Pet" + } + } + }, + "400" : { + "description" : "Invalid status value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/pet/findByTags" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Finds Pets by tags", + "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "operationId" : "findPetsByTags", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "tags", + "in" : "query", + "description" : "Tags to filter by", + "required" : true, + "type" : "array", + "items" : { + "type" : "string" + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Pet" + } + } + }, + "400" : { + "description" : "Invalid tag value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/pet/{petId}" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Find pet by ID", + "description" : "Returns a single pet", + "operationId" : "getPetById", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet to return", + "required" : true, + "type" : "integer", + "format" : "int64" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Pet" + } + }, + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Pet not found" + } + }, + "security" : [ { + "api_key" : [ ] + } ] + }, + "post" : { + "tags" : [ "pet" ], + "summary" : "Updates a pet in the store with form data", + "description" : "", + "operationId" : "updatePetWithForm", + "consumes" : [ "application/x-www-form-urlencoded" ], + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet that needs to be updated", + "required" : true, + "type" : "integer", + "format" : "int64" + }, { + "name" : "name", + "in" : "formData", + "description" : "Updated name of the pet", + "required" : false, + "type" : "string" + }, { + "name" : "status", + "in" : "formData", + "description" : "Updated status of the pet", + "required" : false, + "type" : "string" + } ], + "responses" : { + "405" : { + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + }, + "delete" : { + "tags" : [ "pet" ], + "summary" : "Deletes a pet", + "description" : "", + "operationId" : "deletePet", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "api_key", + "in" : "header", + "required" : false, + "type" : "string" + }, { + "name" : "petId", + "in" : "path", + "description" : "Pet id to delete", + "required" : true, + "type" : "integer", + "format" : "int64" + } ], + "responses" : { + "400" : { + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/pet/{petId}/uploadImage" : { + "post" : { + "tags" : [ "pet" ], + "summary" : "uploads an image", + "description" : "", + "operationId" : "uploadFile", + "consumes" : [ "multipart/form-data" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet to update", + "required" : true, + "type" : "integer", + "format" : "int64" + }, { + "name" : "additionalMetadata", + "in" : "formData", + "description" : "Additional data to pass to server", + "required" : false, + "type" : "string" + }, { + "name" : "file", + "in" : "formData", + "description" : "file to upload", + "required" : false, + "type" : "file" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ApiResponse" + } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/store/inventory" : { + "get" : { + "tags" : [ "store" ], + "summary" : "Returns pet inventories by status", + "description" : "Returns a map of status codes to quantities", + "operationId" : "getInventory", + "produces" : [ "application/json" ], + "parameters" : [ ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "integer", + "format" : "int32" + } + } + } + }, + "security" : [ { + "api_key" : [ ] + } ] + } + }, + "/store/order" : { + "post" : { + "tags" : [ "store" ], + "summary" : "Place an order for a pet", + "description" : "", + "operationId" : "placeOrder", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "order placed for purchasing the pet", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Order" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Order" + } + }, + "400" : { + "description" : "Invalid Order" + } + } + } + }, + "/store/order/{orderId}" : { + "get" : { + "tags" : [ "store" ], + "summary" : "Find purchase order by ID", + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "orderId", + "in" : "path", + "description" : "ID of pet that needs to be fetched", + "required" : true, + "type" : "integer", + "maximum" : 5, + "minimum" : 1, + "format" : "int64" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Order" + } + }, + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Order not found" + } + } + }, + "delete" : { + "tags" : [ "store" ], + "summary" : "Delete purchase order by ID", + "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + "operationId" : "deleteOrder", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "orderId", + "in" : "path", + "description" : "ID of the order that needs to be deleted", + "required" : true, + "type" : "string", + "minimum" : 1 + } ], + "responses" : { + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Order not found" + } + } + } + }, + "/user" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Create user", + "description" : "This can only be done by the logged in user.", + "operationId" : "createUser", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Created user object", + "required" : true, + "schema" : { + "$ref" : "#/definitions/User" + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/user/createWithArray" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Creates list of users with given input array", + "description" : "", + "operationId" : "createUsersWithArrayInput", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "List of user object", + "required" : true, + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/User" + } + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/user/createWithList" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Creates list of users with given input array", + "description" : "", + "operationId" : "createUsersWithListInput", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "List of user object", + "required" : true, + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/User" + } + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/user/login" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Logs user into the system", + "description" : "", + "operationId" : "loginUser", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "username", + "in" : "query", + "description" : "The user name for login", + "required" : true, + "type" : "string" + }, { + "name" : "password", + "in" : "query", + "description" : "The password for login in clear text", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "string" + }, + "headers" : { + "X-Rate-Limit" : { + "type" : "integer", + "format" : "int32", + "description" : "calls per hour allowed by the user" + }, + "X-Expires-After" : { + "type" : "string", + "format" : "date-time", + "description" : "date in UTC when toekn expires" + } + } + }, + "400" : { + "description" : "Invalid username/password supplied" + } + } + } + }, + "/user/logout" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Logs out current logged in user session", + "description" : "", + "operationId" : "logoutUser", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/user/{username}" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Get user by user name", + "description" : "", + "operationId" : "getUserByName", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The name that needs to be fetched. Use user1 for testing. ", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/User" + } + }, + "400" : { + "description" : "Invalid username supplied" + }, + "404" : { + "description" : "User not found" + } + } + }, + "put" : { + "tags" : [ "user" ], + "summary" : "Updated user", + "description" : "This can only be done by the logged in user.", + "operationId" : "updateUser", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "name that need to be deleted", + "required" : true, + "type" : "string" + }, { + "in" : "body", + "name" : "body", + "description" : "Updated user object", + "required" : true, + "schema" : { + "$ref" : "#/definitions/User" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid user supplied" + }, + "404" : { + "description" : "User not found" + } + } + }, + "delete" : { + "tags" : [ "user" ], + "summary" : "Delete user", + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The name that needs to be deleted", + "required" : true, + "type" : "string" + } ], + "responses" : { + "400" : { + "description" : "Invalid username supplied" + }, + "404" : { + "description" : "User not found" + } + } + } + } + }, + "securityDefinitions" : { + "petstore_auth" : { + "type" : "oauth2", + "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", + "flow" : "implicit", + "scopes" : { + "write:pets" : "modify pets in your account", + "read:pets" : "read your pets" + } + }, + "api_key" : { + "type" : "apiKey", + "name" : "api_key", + "in" : "header" + } + }, + "definitions" : { + "Order" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "petId" : { + "type" : "integer", + "format" : "int64" + }, + "quantity" : { + "type" : "integer", + "format" : "int32" + }, + "shipDate" : { + "type" : "string", + "format" : "date-time" + }, + "status" : { + "type" : "string", + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ] + }, + "complete" : { + "type" : "boolean", + "default" : false + } + }, + "title" : "Pet Order", + "description" : "An order for a pets from the pet store", + "xml" : { + "name" : "Order" + } + }, + "Category" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet catehgry", + "description" : "A category for a pet", + "xml" : { + "name" : "Category" + } + }, + "User" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "username" : { + "type" : "string" + }, + "firstName" : { + "type" : "string" + }, + "lastName" : { + "type" : "string" + }, + "email" : { + "type" : "string" + }, + "password" : { + "type" : "string" + }, + "phone" : { + "type" : "string" + }, + "userStatus" : { + "type" : "integer", + "format" : "int32", + "description" : "User Status" + } + }, + "title" : "a User", + "description" : "A User who is purchasing from the pet store", + "xml" : { + "name" : "User" + } + }, + "Tag" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet Tag", + "description" : "A tag for a pet", + "xml" : { + "name" : "Tag" + } + }, + "Pet" : { + "type" : "object", + "required" : [ "name", "photoUrls" ], + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "category" : { + "$ref" : "#/definitions/Category" + }, + "name" : { + "type" : "string", + "example" : "doggie" + }, + "photoUrls" : { + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + }, + "items" : { + "type" : "string" + } + }, + "tags" : { + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + }, + "items" : { + "$ref" : "#/definitions/Tag" + } + }, + "status" : { + "type" : "string", + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ] + } + }, + "title" : "a Pet", + "description" : "A pet for sale in the pet store", + "xml" : { + "name" : "Pet" + } + }, + "ApiResponse" : { + "type" : "object", + "properties" : { + "code" : { + "type" : "integer", + "format" : "int32" + }, + "type" : { + "type" : "string" + }, + "message" : { + "type" : "string" + } + }, + "title" : "An uploaded response", + "description" : "Describes the result of uploading an image resource" + } + }, + "externalDocs" : { + "description" : "Find out more about Swagger", + "url" : "http://swagger.io" + } } \ No newline at end of file From 9f01c5806e6016140646b6da2d2a65214a5cb663 Mon Sep 17 00:00:00 2001 From: "J. Fiala" Date: Fri, 6 Jan 2017 17:44:05 +0100 Subject: [PATCH 03/23] add beanvalidation to jaxrs-cxf-cdi #4091 --- .../languages/AbstractJavaCodegen.java | 13 ++++++++++++ .../JavaJAXRSCXFCDIServerCodegen.java | 20 ++++++++++++++++++- .../resources/JavaJaxRS/cxf-cdi/api.mustache | 4 +++- .../JavaJaxRS/cxf-cdi/model.mustache | 4 +++- .../JavaJaxRS/cxf-cdi/pathParams.mustache | 2 +- .../resources/JavaJaxRS/cxf-cdi/pojo.mustache | 2 +- .../resources/JavaJaxRS/cxf-cdi/pom.mustache | 10 ++++++++++ .../JavaJaxRS/cxf-cdi/queryParams.mustache | 2 +- .../src/gen/java/io/swagger/api/PetApi.java | 5 +++-- .../src/gen/java/io/swagger/api/StoreApi.java | 5 +++-- .../src/gen/java/io/swagger/api/UserApi.java | 3 ++- .../gen/java/io/swagger/model/Category.java | 1 + .../io/swagger/model/ModelApiResponse.java | 1 + .../src/gen/java/io/swagger/model/Order.java | 1 + .../src/gen/java/io/swagger/model/Pet.java | 3 +++ .../src/gen/java/io/swagger/model/Tag.java | 1 + .../src/gen/java/io/swagger/model/User.java | 1 + 17 files changed, 67 insertions(+), 11 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index 2f5860584e0..47b4c17f829 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -1000,5 +1000,18 @@ public void setSupportJava6(boolean value) { public String toRegularExpression(String pattern) { return escapeText(pattern); } + + public boolean convertPropertyToBoolean(String propertyKey) { + boolean booleanValue = false; + if (additionalProperties.containsKey(propertyKey)) { + booleanValue = Boolean.valueOf(additionalProperties.get(propertyKey).toString()); + } + + return booleanValue; + } + + public void writePropertyBack(String propertyKey, boolean value) { + additionalProperties.put(propertyKey, value); + } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java index be214dae514..b48559dd6a6 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java @@ -1,8 +1,10 @@ package io.swagger.codegen.languages; +import io.swagger.codegen.CliOption; import io.swagger.codegen.CodegenModel; import io.swagger.codegen.CodegenProperty; import io.swagger.codegen.SupportingFile; +import io.swagger.codegen.languages.features.BeanValidationFeatures; import java.io.File; @@ -13,7 +15,10 @@ * in /src/gen/java and a sample ServiceImpl in /src/main/java. The API uses CDI * to get an instance of ServiceImpl that implements the Service interface. */ -public class JavaJAXRSCXFCDIServerCodegen extends JavaJAXRSSpecServerCodegen { +public class JavaJAXRSCXFCDIServerCodegen extends JavaJAXRSSpecServerCodegen implements BeanValidationFeatures { + + protected boolean useBeanValidation = true; + /** * Default constructor */ @@ -32,6 +37,8 @@ public JavaJAXRSCXFCDIServerCodegen() { // Updated template directory embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME + File.separator + "cxf-cdi"; + + cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); } @Override @@ -43,6 +50,14 @@ public String getName() { public void processOpts() { super.processOpts(); + if (additionalProperties.containsKey(USE_BEANVALIDATION)) { + this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); + } + + if (useBeanValidation) { + writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + } + supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen // writeOptional means these files are only written if they don't already exist @@ -73,4 +88,7 @@ public String getHelp() { + "Apache CXF runtime and a Java EE runtime with CDI enabled."; } + public void setUseBeanValidation(boolean useBeanValidation) { + this.useBeanValidation = useBeanValidation; + } } 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 5fabe593164..e048e3982aa 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 @@ -16,7 +16,9 @@ import io.swagger.annotations.*; import org.apache.cxf.jaxrs.ext.multipart.Attachment; import java.util.List; - +{{#useBeanValidation}} +import javax.validation.constraints.*; +{{/useBeanValidation}} @Path("/{{baseName}}") @RequestScoped diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache index 2c383a41a28..225cfd719cc 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache @@ -2,7 +2,9 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} - +{{#useBeanValidation}} +import javax.validation.constraints.*; +{{/useBeanValidation}} {{#models}} {{#model}}{{#description}} /** diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pathParams.mustache index 8d80210b4b4..4e21dd6091e 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache index f1d68d014e7..fec2591dcd9 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache @@ -24,7 +24,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{#vendorExtensions.extraAnnotation}}{{vendorExtensions.extraAnnotation}}{{/vendorExtensions.extraAnnotation}} @ApiModelProperty({{#example}}example = "{{example}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") @JsonProperty("{{baseName}}") - public {{{datatypeWithEnum}}} {{getter}}() { +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; } public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache index a5a683b9748..508136322f2 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache @@ -76,6 +76,16 @@ swagger-annotations [1.5.3,2) + +{{#useBeanValidation}} + + + javax.validation + validation-api + 1.1.0.Final + provided + +{{/useBeanValidation}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/queryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/queryParams.mustache index 6bff4a4b82d..c1c9e8b45cb 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/queryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{#defaultValue}}@DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{#defaultValue}}@DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file 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 bca3172e139..9df8f1146bb 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 @@ -17,6 +17,7 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; import java.util.List; +import javax.validation.constraints.*; @Path("/pet") @RequestScoped @@ -77,7 +78,7 @@ public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @P @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") }) - public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="available, pending, sold") @QueryParam("status") List status) { + 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); } @@ -94,7 +95,7 @@ public Response findPetsByStatus(@ApiParam(value = "Status values that need to b @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") }) - public Response findPetsByTags(@ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags) { + public Response findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags) { return delegate.findPetsByTags(tags, 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 d84cd657303..13e71588f67 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 @@ -16,6 +16,7 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; import java.util.List; +import javax.validation.constraints.*; @Path("/store") @RequestScoped @@ -39,7 +40,7 @@ public class StoreApi { @ApiResponses(value = { @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) { + public Response deleteOrder( @Min(1)@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("orderId") String orderId) { return delegate.deleteOrder(orderId, securityContext); } @@ -65,7 +66,7 @@ public Response getInventory() { @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) }) - public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") Long orderId) { + 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); } 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 98394e3b82e..faf2d5143db 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 @@ -16,6 +16,7 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; import java.util.List; +import javax.validation.constraints.*; @Path("/user") @RequestScoped @@ -97,7 +98,7 @@ public Response getUserByName(@ApiParam(value = "The name that needs to be fetch @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.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) { + 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); } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java index 5c941a3a15b..5a429766b3a 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; /** * A category for a pet diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java index 1424e1d4d37..2b65185e9cf 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; /** * Describes the result of uploading an image resource diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java index 450d8606bf4..5fede18f8dc 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; /** * An order for a pets from the pet store diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java index 357b3f0e23c..0b46bc38e7b 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java @@ -7,6 +7,7 @@ import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; +import javax.validation.constraints.*; /** * A pet for sale in the pet store @@ -86,6 +87,7 @@ public Pet name(String name) { @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") + @NotNull public String getName() { return name; } @@ -103,6 +105,7 @@ public Pet photoUrls(List photoUrls) { @ApiModelProperty(example = "null", required = true, value = "") @JsonProperty("photoUrls") + @NotNull public List getPhotoUrls() { return photoUrls; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java index 78b9a6b0a5b..d8574a58e13 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; /** * A tag for a pet diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java index 62b05c0cd43..5bc2c4e5002 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; /** * A User who is purchasing from the pet store From 14bb4325dea1cc4b42a46168066d8a0b3d03c2a9 Mon Sep 17 00:00:00 2001 From: "J. Fiala" Date: Fri, 6 Jan 2017 17:46:46 +0100 Subject: [PATCH 04/23] add beanvalidation to jaxrs-cxf-cdi #4091 --- .../JavaJaxRS/cxf-cdi/beanValidation.mustache | 53 +++++++++++++++++++ .../cxf-cdi/beanValidationPathParams.mustache | 1 + .../beanValidationQueryParams.mustache | 1 + 3 files changed, 55 insertions(+) create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidation.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationPathParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationQueryParams.mustache diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidation.mustache new file mode 100644 index 00000000000..079eab89d1a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidation.mustache @@ -0,0 +1,53 @@ +{{#required}} + @NotNull +{{/required}} +{{#pattern}} + @Pattern(regexp="{{pattern}}") +{{/pattern}} +{{#minLength}} +{{#maxLength}} + @Size(min={{minLength}},max={{maxLength}}) +{{/maxLength}} +{{/minLength}} +{{#minLength}} +{{^maxLength}} + @Size(min={{minLength}}) +{{/maxLength}} +{{/minLength}} +{{^minLength}} +{{#maxLength}} + @Size(max={{maxLength}}) + {{/maxLength}} + {{/minLength}} +{{#minItems}} +{{#maxItems}} + @Size(min={{minItems}},max={{maxItems}}) +{{/maxItems}} +{{/minItems}} +{{#minItems}} +{{^maxItems}} + @Size(min={{minItems}}) +{{/maxItems}} +{{/minItems}} +{{^minItems}} +{{#maxItems}} + @Size(max={{maxItems}}) +{{/maxItems}} +{{/minItems}} +{{! check for integer / number=decimal type}} +{{#isInteger}} +{{#minimum}} + @Min({{minimum}}) +{{/minimum}} +{{#maximum}} + @Max({{maximum}}) +{{/maximum}} +{{/isInteger}} +{{^isInteger}} +{{#minimum}} + @DecimalMin("{{minimum}}") +{{/minimum}} +{{#maximum}} + @DecimalMax("{{maximum}}") +{{/maximum}} +{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationPathParams.mustache new file mode 100644 index 00000000000..e3060fa6c6a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationPathParams.mustache @@ -0,0 +1 @@ +{{! PathParam is always required, no @NotNull necessary }}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationQueryParams.mustache new file mode 100644 index 00000000000..52440b12218 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationQueryParams.mustache @@ -0,0 +1 @@ +{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file From 04b1df04feca48df913acfddf5a8347703b85b1f Mon Sep 17 00:00:00 2001 From: "J. Fiala" Date: Fri, 6 Jan 2017 17:47:43 +0100 Subject: [PATCH 05/23] update crlf --- .../jaxrs-cxf-cdi/.swagger-codegen-ignore | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen-ignore b/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen-ignore index f21535fd6e9..c5fa491b4c5 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen-ignore +++ b/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen-ignore @@ -1,23 +1,23 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md From 2f42133a3d76fc013bd259ecc47cdac28dc4d364 Mon Sep 17 00:00:00 2001 From: "J. Fiala" Date: Tue, 10 Jan 2017 18:02:23 +0100 Subject: [PATCH 06/23] replace tabs --- .../codegen/languages/AbstractJavaCodegen.java | 14 +++++++------- .../languages/JavaJAXRSCXFCDIServerCodegen.java | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index 47b4c17f829..db87e4f4afb 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -1002,16 +1002,16 @@ public String toRegularExpression(String pattern) { } public boolean convertPropertyToBoolean(String propertyKey) { - boolean booleanValue = false; - if (additionalProperties.containsKey(propertyKey)) { - booleanValue = Boolean.valueOf(additionalProperties.get(propertyKey).toString()); + boolean booleanValue = false; + if (additionalProperties.containsKey(propertyKey)) { + booleanValue = Boolean.valueOf(additionalProperties.get(propertyKey).toString()); } return booleanValue; } - - public void writePropertyBack(String propertyKey, boolean value) { - additionalProperties.put(propertyKey, value); - } + + public void writePropertyBack(String propertyKey, boolean value) { + additionalProperties.put(propertyKey, value); + } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java index b48559dd6a6..d3895532f76 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java @@ -16,9 +16,9 @@ * to get an instance of ServiceImpl that implements the Service interface. */ public class JavaJAXRSCXFCDIServerCodegen extends JavaJAXRSSpecServerCodegen implements BeanValidationFeatures { - - protected boolean useBeanValidation = true; - + + protected boolean useBeanValidation = true; + /** * Default constructor */ @@ -51,12 +51,12 @@ public void processOpts() { super.processOpts(); if (additionalProperties.containsKey(USE_BEANVALIDATION)) { - this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); + this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); } - if (useBeanValidation) { - writePropertyBack(USE_BEANVALIDATION, useBeanValidation); - } + if (useBeanValidation) { + writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + } supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen From 7c29f9e9c4ab4aa800782f882b9cd2eaa8ba53f8 Mon Sep 17 00:00:00 2001 From: "J. Fiala" Date: Fri, 6 Jan 2017 17:35:05 +0100 Subject: [PATCH 07/23] add check for hideGenerationTimestamp #4091 --- .../resources/JavaJaxRS/cxf-cdi/generatedAnnotation.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/generatedAnnotation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/generatedAnnotation.mustache index 49110fc1ad9..a47b6faa85b 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/generatedAnnotation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/generatedAnnotation.mustache @@ -1 +1 @@ -@javax.annotation.Generated(value = "{{generatorClass}}", date = "{{generatedDate}}") \ No newline at end of file +{{^hideGenerationTimestamp}}@javax.annotation.Generated(value = "{{generatorClass}}", date = "{{generatedDate}}"){{/hideGenerationTimestamp}} \ No newline at end of file From 84e3a80b0f89d744d83633a23772a202a9674a53 Mon Sep 17 00:00:00 2001 From: "J. Fiala" Date: Fri, 6 Jan 2017 17:37:19 +0100 Subject: [PATCH 08/23] update generated sample with no generated timestamps #4091 --- .../jaxrs-cxf-cdi/.swagger-codegen-ignore | 46 +- samples/server/petstore/jaxrs-cxf-cdi/pom.xml | 162 +- .../src/gen/java/io/swagger/api/PetApi.java | 331 ++-- .../java/io/swagger/api/PetApiService.java | 58 +- .../src/gen/java/io/swagger/api/StoreApi.java | 167 +- .../java/io/swagger/api/StoreApiService.java | 48 +- .../src/gen/java/io/swagger/api/UserApi.java | 253 ++- .../java/io/swagger/api/UserApiService.java | 56 +- .../gen/java/io/swagger/model/Category.java | 191 +- .../io/swagger/model/ModelApiResponse.java | 231 ++- .../src/gen/java/io/swagger/model/Order.java | 387 ++-- .../src/gen/java/io/swagger/model/Pet.java | 395 ++-- .../src/gen/java/io/swagger/model/Tag.java | 191 +- .../src/gen/java/io/swagger/model/User.java | 433 +++-- .../java/io/swagger/api/RestApplication.java | 16 +- .../swagger/api/impl/PetApiServiceImpl.java | 126 +- .../swagger/api/impl/StoreApiServiceImpl.java | 84 +- .../swagger/api/impl/UserApiServiceImpl.java | 124 +- .../src/main/webapp/WEB-INF/beans.xml | 24 +- .../petstore/jaxrs-cxf-cdi/swagger.json | 1660 ++++++++--------- 20 files changed, 2487 insertions(+), 2496 deletions(-) diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen-ignore b/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen-ignore index c5fa491b4c5..f21535fd6e9 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen-ignore +++ b/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen-ignore @@ -1,23 +1,23 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/jaxrs-cxf-cdi/pom.xml b/samples/server/petstore/jaxrs-cxf-cdi/pom.xml index 4534f2961ac..fcd2045b2ff 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-cdi/pom.xml @@ -1,82 +1,82 @@ - - 4.0.0 - io.swagger - swagger-jaxrs-cxf-cdi-server - war - swagger-jaxrs-cxf-cdi-server - 1.0.0 - - - - src/main/java - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.9.1 - - - add-source - generate-sources - - add-source - - - - src/gen/java - - - - - - - - - maven-war-plugin - 3.0.0 - - false - - - - - - - - - - javax - javaee-api - 7.0 - provided - - - - - org.apache.cxf - cxf-rt-frontend-jaxrs - - - 3.0.2 - provided - - - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - [2.8.3,3) - - - - - io.swagger - swagger-annotations - [1.5.3,2) - - - - + + 4.0.0 + io.swagger + swagger-jaxrs-cxf-cdi-server + war + swagger-jaxrs-cxf-cdi-server + 1.0.0 + + + + src/main/java + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + + + maven-war-plugin + 3.0.0 + + false + + + + + + + + + + javax + javaee-api + 7.0 + provided + + + + + org.apache.cxf + cxf-rt-frontend-jaxrs + + + 3.0.2 + provided + + + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + [2.8.3,3) + + + + + io.swagger + swagger-annotations + [1.5.3,2) + + + + \ No newline at end of file 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 df620e58666..bca3172e139 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 @@ -1,166 +1,165 @@ -package io.swagger.api; - -import java.io.File; -import io.swagger.model.ModelApiResponse; -import io.swagger.model.Pet; -import io.swagger.api.PetApiService; - -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; - -import io.swagger.annotations.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.List; - -@Path("/pet") -@RequestScoped - -@Api(description = "the pet API") - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") - -public class PetApi { - - @Context SecurityContext securityContext; - - @Inject PetApiService delegate; - - - @POST - - @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Add a new pet to the store", notes = "", response = void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) - public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { - return delegate.addPet(body, securityContext); - } - - @DELETE - @Path("/{petId}") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Deletes a pet", notes = "", response = void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid pet value", response = void.class) }) - 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); - } - - @GET - @Path("/findByStatus") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) - public Response findPetsByStatus(@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); - } - - @GET - @Path("/findByTags") - - @Produces({ "application/xml", "application/json" }) - @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 = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) - public Response findPetsByTags(@ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags) { - return delegate.findPetsByTags(tags, securityContext); - } - - @GET - @Path("/{petId}") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, 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) }) - public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId) { - return delegate.getPetById(petId, securityContext); - } - - @PUT - - @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Update an existing pet", notes = "", response = void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), - @ApiResponse(code = 404, message = "Pet not found", response = void.class), - @ApiResponse(code = 405, message = "Validation exception", response = void.class) }) - public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { - return delegate.updatePet(body, securityContext); - } - - @POST - @Path("/{petId}") - @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) - 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); - } - - @POST - @Path("/{petId}/uploadImage") - @Consumes({ "multipart/form-data" }) - @Produces({ "application/json" }) - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file", required = false) InputStream fileInputStream, @Multipart(value = "file" , required = false) Attachment fileDetail) { - return delegate.uploadFile(petId, additionalMetadata, inputStream, fileDetail, securityContext); - } -} +package io.swagger.api; + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; +import io.swagger.api.PetApiService; + +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; + +import io.swagger.annotations.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.List; +@Path("/pet") +@RequestScoped + +@Api(description = "the pet API") + + + + +public class PetApi { + + @Context SecurityContext securityContext; + + @Inject PetApiService delegate; + + + @POST + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Add a new pet to the store", notes = "", response = void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { + return delegate.addPet(body, securityContext); + } + + @DELETE + @Path("/{petId}") + + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Deletes a pet", notes = "", response = void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid pet value", response = void.class) }) + 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); + } + + @GET + @Path("/findByStatus") + + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + public Response findPetsByStatus(@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); + } + + @GET + @Path("/findByTags") + + @Produces({ "application/xml", "application/json" }) + @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 = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + public Response findPetsByTags(@ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags) { + return delegate.findPetsByTags(tags, securityContext); + } + + @GET + @Path("/{petId}") + + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @Authorization(value = "api_key") + }, 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) }) + public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId) { + return delegate.getPetById(petId, securityContext); + } + + @PUT + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Update an existing pet", notes = "", response = void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), + @ApiResponse(code = 404, message = "Pet not found", response = void.class), + @ApiResponse(code = 405, message = "Validation exception", response = void.class) }) + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { + return delegate.updatePet(body, securityContext); + } + + @POST + @Path("/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + 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); + } + + @POST + @Path("/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file", required = false) InputStream fileInputStream, @Multipart(value = "file" , required = false) Attachment fileDetail) { + return delegate.uploadFile(petId, additionalMetadata, inputStream, fileDetail, securityContext); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java index 924bf6ea7da..0ed0a9da2ce 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java @@ -1,29 +1,29 @@ -package io.swagger.api; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.io.File; -import io.swagger.model.ModelApiResponse; -import io.swagger.model.Pet; - -import java.util.List; - -import java.io.InputStream; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") -public interface PetApiService { - public Response addPet(Pet body, SecurityContext securityContext); - public Response deletePet(Long petId, String apiKey, SecurityContext securityContext); - public Response findPetsByStatus(List status, SecurityContext securityContext); - public Response findPetsByTags(List tags, SecurityContext securityContext); - public Response getPetById(Long petId, SecurityContext securityContext); - public Response updatePet(Pet body, SecurityContext securityContext); - public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext); - public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, Attachment fileDetail, SecurityContext securityContext); -} +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public interface PetApiService { + public Response addPet(Pet body, SecurityContext securityContext); + public Response deletePet(Long petId, String apiKey, SecurityContext securityContext); + public Response findPetsByStatus(List status, SecurityContext securityContext); + public Response findPetsByTags(List tags, SecurityContext securityContext); + public Response getPetById(Long petId, SecurityContext securityContext); + public Response updatePet(Pet body, SecurityContext securityContext); + public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext); + public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, Attachment fileDetail, SecurityContext 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 9531172123c..d84cd657303 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 @@ -1,84 +1,83 @@ -package io.swagger.api; - -import java.util.Map; -import io.swagger.model.Order; -import io.swagger.api.StoreApiService; - -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; - -import io.swagger.annotations.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.List; - -@Path("/store") -@RequestScoped - -@Api(description = "the store API") - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") - -public class StoreApi { - - @Context SecurityContext securityContext; - - @Inject StoreApiService delegate; - - - @DELETE - @Path("/order/{orderId}") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = void.class, tags={ "store", }) - @ApiResponses(value = { - @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); - } - - @GET - @Path("/inventory") - - @Produces({ "application/json" }) - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { - @Authorization(value = "api_key") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) - public Response getInventory() { - return delegate.getInventory(securityContext); - } - - @GET - @Path("/order/{orderId}") - - @Produces({ "application/xml", "application/json" }) - @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) }) - public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") Long orderId) { - return delegate.getOrderById(orderId, securityContext); - } - - @POST - @Path("/order") - - @Produces({ "application/xml", "application/json" }) - @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) }) - public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body) { - return delegate.placeOrder(body, securityContext); - } -} +package io.swagger.api; + +import java.util.Map; +import io.swagger.model.Order; +import io.swagger.api.StoreApiService; + +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; + +import io.swagger.annotations.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.List; +@Path("/store") +@RequestScoped + +@Api(description = "the store API") + + + + +public class StoreApi { + + @Context SecurityContext securityContext; + + @Inject StoreApiService delegate; + + + @DELETE + @Path("/order/{orderId}") + + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = void.class, tags={ "store", }) + @ApiResponses(value = { + @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); + } + + @GET + @Path("/inventory") + + @Produces({ "application/json" }) + @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @Authorization(value = "api_key") + }, tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + public Response getInventory() { + return delegate.getInventory(securityContext); + } + + @GET + @Path("/order/{orderId}") + + @Produces({ "application/xml", "application/json" }) + @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) }) + public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") Long orderId) { + return delegate.getOrderById(orderId, securityContext); + } + + @POST + @Path("/order") + + @Produces({ "application/xml", "application/json" }) + @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) }) + 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/StoreApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java index 3ea40b6fbc1..962f3e16965 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java @@ -1,24 +1,24 @@ -package io.swagger.api; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.Map; -import io.swagger.model.Order; - -import java.util.List; - -import java.io.InputStream; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") -public interface StoreApiService { - public Response deleteOrder(String orderId, SecurityContext securityContext); - public Response getInventory(SecurityContext securityContext); - public Response getOrderById(Long orderId, SecurityContext securityContext); - public Response placeOrder(Order body, SecurityContext securityContext); -} +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public interface StoreApiService { + public Response deleteOrder(String orderId, SecurityContext securityContext); + public Response getInventory(SecurityContext securityContext); + public Response getOrderById(Long orderId, SecurityContext securityContext); + public Response placeOrder(Order body, SecurityContext 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 cc052a69955..98394e3b82e 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 @@ -1,127 +1,126 @@ -package io.swagger.api; - -import java.util.List; -import io.swagger.model.User; -import io.swagger.api.UserApiService; - -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; - -import io.swagger.annotations.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.List; - -@Path("/user") -@RequestScoped - -@Api(description = "the user API") - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") - -public class UserApi { - - @Context SecurityContext securityContext; - - @Inject UserApiService delegate; - - - @POST - - - @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) }) - public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body) { - return delegate.createUser(body, securityContext); - } - - @POST - @Path("/createWithArray") - - @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) }) - public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body) { - return delegate.createUsersWithArrayInput(body, securityContext); - } - - @POST - @Path("/createWithList") - - @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) }) - public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body) { - return delegate.createUsersWithListInput(body, securityContext); - } - - @DELETE - @Path("/{username}") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) - @ApiResponses(value = { - @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); - } - - @GET - @Path("/{username}") - - @Produces({ "application/xml", "application/json" }) - @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) }) - 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); - } - - @GET - @Path("/login") - - @Produces({ "application/xml", "application/json" }) - @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) }) - 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) { - return delegate.loginUser(username, password, securityContext); - } - - @GET - @Path("/logout") - - @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) }) - public Response logoutUser() { - return delegate.logoutUser(securityContext); - } - - @PUT - @Path("/{username}") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user" }) - @ApiResponses(value = { - @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); - } -} +package io.swagger.api; + +import java.util.List; +import io.swagger.model.User; +import io.swagger.api.UserApiService; + +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; + +import io.swagger.annotations.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.List; +@Path("/user") +@RequestScoped + +@Api(description = "the user API") + + + + +public class UserApi { + + @Context SecurityContext securityContext; + + @Inject UserApiService delegate; + + + @POST + + + @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) }) + public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body) { + return delegate.createUser(body, securityContext); + } + + @POST + @Path("/createWithArray") + + @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) }) + public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body) { + return delegate.createUsersWithArrayInput(body, securityContext); + } + + @POST + @Path("/createWithList") + + @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) }) + public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body) { + return delegate.createUsersWithListInput(body, securityContext); + } + + @DELETE + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) + @ApiResponses(value = { + @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); + } + + @GET + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @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) }) + 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); + } + + @GET + @Path("/login") + + @Produces({ "application/xml", "application/json" }) + @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) }) + 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) { + return delegate.loginUser(username, password, securityContext); + } + + @GET + @Path("/logout") + + @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) }) + public Response logoutUser() { + return delegate.logoutUser(securityContext); + } + + @PUT + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user" }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied", response = void.class), + @ApiResponse(code = 404, message = "User not found", response = void.class) }) + public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username, @ApiParam(value = "Updated user object" ,required=true) User body) { + return delegate.updateUser(username, body, securityContext); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java index 14187d1302f..922b7ac3021 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java @@ -1,28 +1,28 @@ -package io.swagger.api; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.List; -import io.swagger.model.User; - -import java.util.List; - -import java.io.InputStream; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") -public interface UserApiService { - public Response createUser(User body, SecurityContext securityContext); - public Response createUsersWithArrayInput(List body, SecurityContext securityContext); - public Response createUsersWithListInput(List body, SecurityContext securityContext); - public Response deleteUser(String username, SecurityContext securityContext); - public Response getUserByName(String username, SecurityContext securityContext); - public Response loginUser(String username, String password, SecurityContext securityContext); - public Response logoutUser(SecurityContext securityContext); - public Response updateUser(String username, User body, SecurityContext securityContext); -} +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.List; +import io.swagger.model.User; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public interface UserApiService { + public Response createUser(User body, SecurityContext securityContext); + public Response createUsersWithArrayInput(List body, SecurityContext securityContext); + public Response createUsersWithListInput(List body, SecurityContext securityContext); + public Response deleteUser(String username, SecurityContext securityContext); + public Response getUserByName(String username, SecurityContext securityContext); + public Response loginUser(String username, String password, SecurityContext securityContext); + public Response logoutUser(SecurityContext securityContext); + public Response updateUser(String username, User body, SecurityContext securityContext); +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java index 79ba2971c54..5c941a3a15b 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java @@ -1,96 +1,95 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; - - -/** - * A category for a pet - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "A category for a pet") - -public class Category { - - private Long id = null; - private String name = null; - - /** - **/ - public Category id(Long id) { - this.id = id; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - public Category name(String name) { - this.name = name; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(id, category.id) && - Objects.equals(name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; + +/** + * A category for a pet + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "A category for a pet") + +public class Category { + + private Long id = null; + private String name = null; + + /** + **/ + public Category id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Category name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(id, category.id) && + Objects.equals(name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java index a42de8ae1e1..1424e1d4d37 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -1,116 +1,115 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; - - -/** - * Describes the result of uploading an image resource - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "Describes the result of uploading an image resource") - -public class ModelApiResponse { - - private Integer code = null; - private String type = null; - private String message = null; - - /** - **/ - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("code") - public Integer getCode() { - return code; - } - public void setCode(Integer code) { - this.code = code; - } - - /** - **/ - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("type") - public String getType() { - return type; - } - public void setType(String type) { - this.type = type; - } - - /** - **/ - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("message") - public String getMessage() { - return message; - } - public void setMessage(String message) { - this.message = message; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(code, _apiResponse.code) && - Objects.equals(type, _apiResponse.type) && - Objects.equals(message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; + +/** + * Describes the result of uploading an image resource + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "Describes the result of uploading an image resource") + +public class ModelApiResponse { + + private Integer code = null; + private String type = null; + private String message = null; + + /** + **/ + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("code") + public Integer getCode() { + return code; + } + public void setCode(Integer code) { + this.code = code; + } + + /** + **/ + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("type") + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + /** + **/ + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("message") + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(code, _apiResponse.code) && + Objects.equals(type, _apiResponse.type) && + Objects.equals(message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java index d1fd9f10f03..450d8606bf4 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java @@ -1,194 +1,193 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; - - -/** - * An order for a pets from the pet store - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "An order for a pets from the pet store") - -public class Order { - - private Long id = null; - private Long petId = null; - private Integer quantity = null; - private java.util.Date shipDate = null; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name="Order") -@XmlEnum -public enum Order { - {values=[placed, approved, delivered], enumVars=[{name=PLACED, value="placed"}, {name=APPROVED, value="approved"}, {name=DELIVERED, value="delivered"}]}, - - public String value() { - return name(); - } - - public static Order fromValue(String v) { - return valueOf(v); - } -} - private StatusEnum status = null; - private Boolean complete = false; - - /** - **/ - public Order id(Long id) { - this.id = id; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("petId") - public Long getPetId() { - return petId; - } - public void setPetId(Long petId) { - this.petId = petId; - } - - /** - **/ - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("quantity") - public Integer getQuantity() { - return quantity; - } - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - /** - **/ - public Order shipDate(java.util.Date shipDate) { - this.shipDate = shipDate; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("shipDate") - public java.util.Date getShipDate() { - return shipDate; - } - public void setShipDate(java.util.Date shipDate) { - this.shipDate = shipDate; - } - - /** - * Order Status - **/ - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - - @ApiModelProperty(example = "null", value = "Order Status") - @JsonProperty("status") - public StatusEnum getStatus() { - return status; - } - public void setStatus(StatusEnum status) { - this.status = status; - } - - /** - **/ - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("complete") - public Boolean getComplete() { - return complete; - } - public void setComplete(Boolean complete) { - this.complete = complete; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(id, order.id) && - Objects.equals(petId, order.petId) && - Objects.equals(quantity, order.quantity) && - Objects.equals(shipDate, order.shipDate) && - Objects.equals(status, order.status) && - Objects.equals(complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; + +/** + * An order for a pets from the pet store + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "An order for a pets from the pet store") + +public class Order { + + private Long id = null; + private Long petId = null; + private Integer quantity = null; + private java.util.Date shipDate = null; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="Order") +@XmlEnum +public enum Order { + {values=[placed, approved, delivered], enumVars=[{name=PLACED, value="placed"}, {name=APPROVED, value="approved"}, {name=DELIVERED, value="delivered"}]}, + + public String value() { + return name(); + } + + public static Order fromValue(String v) { + return valueOf(v); + } +} + private StatusEnum status = null; + private Boolean complete = false; + + /** + **/ + public Order id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + public void setPetId(Long petId) { + this.petId = petId; + } + + /** + **/ + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + /** + **/ + public Order shipDate(java.util.Date shipDate) { + this.shipDate = shipDate; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("shipDate") + public java.util.Date getShipDate() { + return shipDate; + } + public void setShipDate(java.util.Date shipDate) { + this.shipDate = shipDate; + } + + /** + * Order Status + **/ + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + + @ApiModelProperty(example = "null", value = "Order Status") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + **/ + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("complete") + public Boolean getComplete() { + return complete; + } + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(id, order.id) && + Objects.equals(petId, order.petId) && + Objects.equals(quantity, order.quantity) && + Objects.equals(shipDate, order.shipDate) && + Objects.equals(status, order.status) && + Objects.equals(complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java index ebbe32b810f..357b3f0e23c 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java @@ -1,198 +1,197 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.model.Category; -import io.swagger.model.Tag; -import java.util.ArrayList; -import java.util.List; - - -/** - * A pet for sale in the pet store - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "A pet for sale in the pet store") - -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(); - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name="Pet") -@XmlEnum -public enum Pet { - {values=[available, pending, sold], enumVars=[{name=AVAILABLE, value="available"}, {name=PENDING, value="pending"}, {name=SOLD, value="sold"}]}, - - public String value() { - return name(); - } - - public static Pet fromValue(String v) { - return valueOf(v); - } -} - private StatusEnum status = null; - - /** - **/ - public Pet id(Long id) { - this.id = id; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - public Pet category(Category category) { - this.category = category; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("category") - public Category getCategory() { - return category; - } - public void setCategory(Category category) { - this.category = category; - } - - /** - **/ - public Pet name(String name) { - this.name = name; - return this; - } - - - @ApiModelProperty(example = "doggie", required = true, value = "") - @JsonProperty("name") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - /** - **/ - public Pet photoUrls(List photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - - @ApiModelProperty(example = "null", required = true, value = "") - @JsonProperty("photoUrls") - public List getPhotoUrls() { - return photoUrls; - } - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } - - /** - **/ - public Pet tags(List tags) { - this.tags = tags; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("tags") - public List getTags() { - return tags; - } - public void setTags(List tags) { - this.tags = tags; - } - - /** - * pet status in the store - **/ - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - - @ApiModelProperty(example = "null", value = "pet status in the store") - @JsonProperty("status") - public StatusEnum getStatus() { - return status; - } - public void setStatus(StatusEnum status) { - this.status = status; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(id, pet.id) && - Objects.equals(category, pet.category) && - Objects.equals(name, pet.name) && - Objects.equals(photoUrls, pet.photoUrls) && - Objects.equals(tags, pet.tags) && - Objects.equals(status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.model.Category; +import io.swagger.model.Tag; +import java.util.ArrayList; +import java.util.List; + +/** + * A pet for sale in the pet store + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "A pet for sale in the pet store") + +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(); + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="Pet") +@XmlEnum +public enum Pet { + {values=[available, pending, sold], enumVars=[{name=AVAILABLE, value="available"}, {name=PENDING, value="pending"}, {name=SOLD, value="sold"}]}, + + public String value() { + return name(); + } + + public static Pet fromValue(String v) { + return valueOf(v); + } +} + private StatusEnum status = null; + + /** + **/ + public Pet id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Pet category(Category category) { + this.category = category; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("category") + public Category getCategory() { + return category; + } + public void setCategory(Category category) { + this.category = category; + } + + /** + **/ + public Pet name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + /** + **/ + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("photoUrls") + public List getPhotoUrls() { + return photoUrls; + } + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + /** + **/ + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("tags") + public List getTags() { + return tags; + } + public void setTags(List tags) { + this.tags = tags; + } + + /** + * pet status in the store + **/ + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + + @ApiModelProperty(example = "null", value = "pet status in the store") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(id, pet.id) && + Objects.equals(category, pet.category) && + Objects.equals(name, pet.name) && + Objects.equals(photoUrls, pet.photoUrls) && + Objects.equals(tags, pet.tags) && + Objects.equals(status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java index dc277dedce7..78b9a6b0a5b 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java @@ -1,96 +1,95 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; - - -/** - * A tag for a pet - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "A tag for a pet") - -public class Tag { - - private Long id = null; - private String name = null; - - /** - **/ - public Tag id(Long id) { - this.id = id; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - public Tag name(String name) { - this.name = name; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(id, tag.id) && - Objects.equals(name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; + +/** + * A tag for a pet + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "A tag for a pet") + +public class Tag { + + private Long id = null; + private String name = null; + + /** + **/ + public Tag id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Tag name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(id, tag.id) && + Objects.equals(name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java index 0cc5cae6d6e..62b05c0cd43 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java @@ -1,217 +1,216 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; - - -/** - * A User who is purchasing from the pet store - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "A User who is purchasing from the pet store") - -public class User { - - private Long id = null; - private String username = null; - private String firstName = null; - private String lastName = null; - private String email = null; - private String password = null; - private String phone = null; - private Integer userStatus = null; - - /** - **/ - public User id(Long id) { - this.id = id; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - public User username(String username) { - this.username = username; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("username") - public String getUsername() { - return username; - } - public void setUsername(String username) { - this.username = username; - } - - /** - **/ - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("firstName") - public String getFirstName() { - return firstName; - } - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - /** - **/ - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("lastName") - public String getLastName() { - return lastName; - } - public void setLastName(String lastName) { - this.lastName = lastName; - } - - /** - **/ - public User email(String email) { - this.email = email; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("email") - public String getEmail() { - return email; - } - public void setEmail(String email) { - this.email = email; - } - - /** - **/ - public User password(String password) { - this.password = password; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("password") - public String getPassword() { - return password; - } - public void setPassword(String password) { - this.password = password; - } - - /** - **/ - public User phone(String phone) { - this.phone = phone; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("phone") - public String getPhone() { - return phone; - } - public void setPhone(String phone) { - this.phone = phone; - } - - /** - * User Status - **/ - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - - @ApiModelProperty(example = "null", value = "User Status") - @JsonProperty("userStatus") - public Integer getUserStatus() { - return userStatus; - } - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(id, user.id) && - Objects.equals(username, user.username) && - Objects.equals(firstName, user.firstName) && - Objects.equals(lastName, user.lastName) && - Objects.equals(email, user.email) && - Objects.equals(password, user.password) && - Objects.equals(phone, user.phone) && - Objects.equals(userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; + +/** + * A User who is purchasing from the pet store + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "A User who is purchasing from the pet store") + +public class User { + + private Long id = null; + private String username = null; + private String firstName = null; + private String lastName = null; + private String email = null; + private String password = null; + private String phone = null; + private Integer userStatus = null; + + /** + **/ + public User id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public User username(String username) { + this.username = username; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("username") + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + /** + **/ + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + **/ + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + **/ + public User email(String email) { + this.email = email; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("email") + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + /** + **/ + public User password(String password) { + this.password = password; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("password") + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + /** + **/ + public User phone(String phone) { + this.phone = phone; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("phone") + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + + /** + * User Status + **/ + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + + @ApiModelProperty(example = "null", value = "User Status") + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(id, user.id) && + Objects.equals(username, user.username) && + Objects.equals(firstName, user.firstName) && + Objects.equals(lastName, user.lastName) && + Objects.equals(email, user.email) && + Objects.equals(password, user.password) && + Objects.equals(phone, user.phone) && + Objects.equals(userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/RestApplication.java index 1ae54938776..3b43beeb9be 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/RestApplication.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/RestApplication.java @@ -1,9 +1,9 @@ -package io.swagger.api; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -@ApplicationPath("/") -public class RestApplication extends Application { - // Add implementation-specific details here +package io.swagger.api; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +@ApplicationPath("/") +public class RestApplication extends Application { + // Add implementation-specific details here } \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index 3a03e87fc7d..171bdabcb05 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -1,63 +1,63 @@ -package io.swagger.api.impl; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.io.File; -import io.swagger.model.ModelApiResponse; -import io.swagger.model.Pet; - -import java.util.List; - -import java.io.InputStream; - -import javax.enterprise.context.RequestScoped; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@RequestScoped -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") -public class PetApiServiceImpl implements PetApiService { - @Override - public Response addPet(Pet body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response deletePet(Long petId, String apiKey, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response findPetsByStatus(List status, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response findPetsByTags(List tags, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response getPetById(Long petId, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response updatePet(Pet body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, Attachment fileDetail, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } -} +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import java.util.List; + +import java.io.InputStream; + +import javax.enterprise.context.RequestScoped; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@RequestScoped + +public class PetApiServiceImpl implements PetApiService { + @Override + public Response addPet(Pet body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response deletePet(Long petId, String apiKey, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response findPetsByStatus(List status, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response findPetsByTags(List tags, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response getPetById(Long petId, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response updatePet(Pet body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, Attachment fileDetail, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index fed0fa6c0f0..9463e955569 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -1,42 +1,42 @@ -package io.swagger.api.impl; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.Map; -import io.swagger.model.Order; - -import java.util.List; - -import java.io.InputStream; - -import javax.enterprise.context.RequestScoped; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@RequestScoped -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") -public class StoreApiServiceImpl implements StoreApiService { - @Override - public Response deleteOrder(String orderId, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response getInventory(SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response getOrderById(Long orderId, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response placeOrder(Order body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } -} +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; + +import java.io.InputStream; + +import javax.enterprise.context.RequestScoped; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@RequestScoped + +public class StoreApiServiceImpl implements StoreApiService { + @Override + public Response deleteOrder(String orderId, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response getInventory(SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response getOrderById(Long orderId, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response placeOrder(Order body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index 4f4b3db2382..ab011633fe3 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -1,62 +1,62 @@ -package io.swagger.api.impl; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.List; -import io.swagger.model.User; - -import java.util.List; - -import java.io.InputStream; - -import javax.enterprise.context.RequestScoped; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@RequestScoped -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-11-17T08:53:42.205Z") -public class UserApiServiceImpl implements UserApiService { - @Override - public Response createUser(User body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response createUsersWithArrayInput(List body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response createUsersWithListInput(List body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response deleteUser(String username, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response getUserByName(String username, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response loginUser(String username, String password, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response logoutUser(SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response updateUser(String username, User body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } -} +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.List; +import io.swagger.model.User; + +import java.util.List; + +import java.io.InputStream; + +import javax.enterprise.context.RequestScoped; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@RequestScoped + +public class UserApiServiceImpl implements UserApiService { + @Override + public Response createUser(User body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response createUsersWithArrayInput(List body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response createUsersWithListInput(List body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response deleteUser(String username, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response getUserByName(String username, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response loginUser(String username, String password, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response logoutUser(SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response updateUser(String username, User body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/webapp/WEB-INF/beans.xml b/samples/server/petstore/jaxrs-cxf-cdi/src/main/webapp/WEB-INF/beans.xml index cb6d500d43f..f9f7d3d948b 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/webapp/WEB-INF/beans.xml +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/webapp/WEB-INF/beans.xml @@ -1,13 +1,13 @@ - - - - - + + + + + \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json index f48e38d5cb2..a3adac3d4ac 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json +++ b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json @@ -1,831 +1,831 @@ -{ - "swagger" : "2.0", - "info" : { - "description" : "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", - "version" : "1.0.0", - "title" : "Swagger Petstore", - "termsOfService" : "http://swagger.io/terms/", - "contact" : { - "email" : "apiteam@swagger.io" - }, - "license" : { - "name" : "Apache 2.0", - "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" - } - }, - "host" : "petstore.swagger.io", - "basePath" : "/v2", - "tags" : [ { - "name" : "pet", - "description" : "Everything about your Pets", - "externalDocs" : { - "description" : "Find out more", - "url" : "http://swagger.io" - } - }, { - "name" : "store", - "description" : "Access to Petstore orders" - }, { - "name" : "user", - "description" : "Operations about user", - "externalDocs" : { - "description" : "Find out more about our store", - "url" : "http://swagger.io" - } - } ], - "schemes" : [ "http" ], - "paths" : { - "/pet" : { - "post" : { - "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "description" : "", - "operationId" : "addPet", - "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Pet object that needs to be added to the store", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Pet" - } - } ], - "responses" : { - "405" : { - "description" : "Invalid input" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - }, - "put" : { - "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "description" : "", - "operationId" : "updatePet", - "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Pet object that needs to be added to the store", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Pet" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" - }, - "405" : { - "description" : "Validation exception" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - } - }, - "/pet/findByStatus" : { - "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by status", - "description" : "Multiple status values can be provided with comma separated strings", - "operationId" : "findPetsByStatus", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "status", - "in" : "query", - "description" : "Status values that need to be considered for filter", - "required" : true, - "type" : "array", - "items" : { - "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] - }, - "collectionFormat" : "csv" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" - } - } - }, - "400" : { - "description" : "Invalid status value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - } - }, - "/pet/findByTags" : { - "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by tags", - "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - "operationId" : "findPetsByTags", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "tags", - "in" : "query", - "description" : "Tags to filter by", - "required" : true, - "type" : "array", - "items" : { - "type" : "string" - }, - "collectionFormat" : "csv" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" - } - } - }, - "400" : { - "description" : "Invalid tag value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - } - }, - "/pet/{petId}" : { - "get" : { - "tags" : [ "pet" ], - "summary" : "Find pet by ID", - "description" : "Returns a single pet", - "operationId" : "getPetById", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "petId", - "in" : "path", - "description" : "ID of pet to return", - "required" : true, - "type" : "integer", - "format" : "int64" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Pet" - } - }, - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" - } - }, - "security" : [ { - "api_key" : [ ] - } ] - }, - "post" : { - "tags" : [ "pet" ], - "summary" : "Updates a pet in the store with form data", - "description" : "", - "operationId" : "updatePetWithForm", - "consumes" : [ "application/x-www-form-urlencoded" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "petId", - "in" : "path", - "description" : "ID of pet that needs to be updated", - "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "name", - "in" : "formData", - "description" : "Updated name of the pet", - "required" : false, - "type" : "string" - }, { - "name" : "status", - "in" : "formData", - "description" : "Updated status of the pet", - "required" : false, - "type" : "string" - } ], - "responses" : { - "405" : { - "description" : "Invalid input" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - }, - "delete" : { - "tags" : [ "pet" ], - "summary" : "Deletes a pet", - "description" : "", - "operationId" : "deletePet", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "api_key", - "in" : "header", - "required" : false, - "type" : "string" - }, { - "name" : "petId", - "in" : "path", - "description" : "Pet id to delete", - "required" : true, - "type" : "integer", - "format" : "int64" - } ], - "responses" : { - "400" : { - "description" : "Invalid pet value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - } - }, - "/pet/{petId}/uploadImage" : { - "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image", - "description" : "", - "operationId" : "uploadFile", - "consumes" : [ "multipart/form-data" ], - "produces" : [ "application/json" ], - "parameters" : [ { - "name" : "petId", - "in" : "path", - "description" : "ID of pet to update", - "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "additionalMetadata", - "in" : "formData", - "description" : "Additional data to pass to server", - "required" : false, - "type" : "string" - }, { - "name" : "file", - "in" : "formData", - "description" : "file to upload", - "required" : false, - "type" : "file" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/ApiResponse" - } - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - } - }, - "/store/inventory" : { - "get" : { - "tags" : [ "store" ], - "summary" : "Returns pet inventories by status", - "description" : "Returns a map of status codes to quantities", - "operationId" : "getInventory", - "produces" : [ "application/json" ], - "parameters" : [ ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "object", - "additionalProperties" : { - "type" : "integer", - "format" : "int32" - } - } - } - }, - "security" : [ { - "api_key" : [ ] - } ] - } - }, - "/store/order" : { - "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", - "description" : "", - "operationId" : "placeOrder", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "order placed for purchasing the pet", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Order" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" - } - }, - "400" : { - "description" : "Invalid Order" - } - } - } - }, - "/store/order/{orderId}" : { - "get" : { - "tags" : [ "store" ], - "summary" : "Find purchase order by ID", - "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - "operationId" : "getOrderById", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "orderId", - "in" : "path", - "description" : "ID of pet that needs to be fetched", - "required" : true, - "type" : "integer", - "maximum" : 5.0, - "minimum" : 1.0, - "format" : "int64" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" - } - }, - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Order not found" - } - } - }, - "delete" : { - "tags" : [ "store" ], - "summary" : "Delete purchase order by ID", - "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", - "operationId" : "deleteOrder", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "orderId", - "in" : "path", - "description" : "ID of the order that needs to be deleted", - "required" : true, - "type" : "string", - "minimum" : 1.0 - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Order not found" - } - } - } - }, - "/user" : { - "post" : { - "tags" : [ "user" ], - "summary" : "Create user", - "description" : "This can only be done by the logged in user.", - "operationId" : "createUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Created user object", - "required" : true, - "schema" : { - "$ref" : "#/definitions/User" - } - } ], - "responses" : { - "default" : { - "description" : "successful operation" - } - } - } - }, - "/user/createWithArray" : { - "post" : { - "tags" : [ "user" ], - "summary" : "Creates list of users with given input array", - "description" : "", - "operationId" : "createUsersWithArrayInput", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "List of user object", - "required" : true, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/User" - } - } - } ], - "responses" : { - "default" : { - "description" : "successful operation" - } - } - } - }, - "/user/createWithList" : { - "post" : { - "tags" : [ "user" ], - "summary" : "Creates list of users with given input array", - "description" : "", - "operationId" : "createUsersWithListInput", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "List of user object", - "required" : true, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/User" - } - } - } ], - "responses" : { - "default" : { - "description" : "successful operation" - } - } - } - }, - "/user/login" : { - "get" : { - "tags" : [ "user" ], - "summary" : "Logs user into the system", - "description" : "", - "operationId" : "loginUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "query", - "description" : "The user name for login", - "required" : true, - "type" : "string" - }, { - "name" : "password", - "in" : "query", - "description" : "The password for login in clear text", - "required" : true, - "type" : "string" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "string" - }, - "headers" : { - "X-Rate-Limit" : { - "type" : "integer", - "format" : "int32", - "description" : "calls per hour allowed by the user" - }, - "X-Expires-After" : { - "type" : "string", - "format" : "date-time", - "description" : "date in UTC when toekn expires" - } - } - }, - "400" : { - "description" : "Invalid username/password supplied" - } - } - } - }, - "/user/logout" : { - "get" : { - "tags" : [ "user" ], - "summary" : "Logs out current logged in user session", - "description" : "", - "operationId" : "logoutUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ ], - "responses" : { - "default" : { - "description" : "successful operation" - } - } - } - }, - "/user/{username}" : { - "get" : { - "tags" : [ "user" ], - "summary" : "Get user by user name", - "description" : "", - "operationId" : "getUserByName", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "The name that needs to be fetched. Use user1 for testing. ", - "required" : true, - "type" : "string" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/User" - } - }, - "400" : { - "description" : "Invalid username supplied" - }, - "404" : { - "description" : "User not found" - } - } - }, - "put" : { - "tags" : [ "user" ], - "summary" : "Updated user", - "description" : "This can only be done by the logged in user.", - "operationId" : "updateUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "name that need to be deleted", - "required" : true, - "type" : "string" - }, { - "in" : "body", - "name" : "body", - "description" : "Updated user object", - "required" : true, - "schema" : { - "$ref" : "#/definitions/User" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid user supplied" - }, - "404" : { - "description" : "User not found" - } - } - }, - "delete" : { - "tags" : [ "user" ], - "summary" : "Delete user", - "description" : "This can only be done by the logged in user.", - "operationId" : "deleteUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "The name that needs to be deleted", - "required" : true, - "type" : "string" - } ], - "responses" : { - "400" : { - "description" : "Invalid username supplied" - }, - "404" : { - "description" : "User not found" - } - } - } - } - }, - "securityDefinitions" : { - "petstore_auth" : { - "type" : "oauth2", - "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", - "flow" : "implicit", - "scopes" : { - "write:pets" : "modify pets in your account", - "read:pets" : "read your pets" - } - }, - "api_key" : { - "type" : "apiKey", - "name" : "api_key", - "in" : "header" - } - }, - "definitions" : { - "Order" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "petId" : { - "type" : "integer", - "format" : "int64" - }, - "quantity" : { - "type" : "integer", - "format" : "int32" - }, - "shipDate" : { - "type" : "string", - "format" : "date-time" - }, - "status" : { - "type" : "string", - "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] - }, - "complete" : { - "type" : "boolean", - "default" : false - } - }, - "title" : "Pet Order", - "description" : "An order for a pets from the pet store", - "xml" : { - "name" : "Order" - } - }, - "Category" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - } - }, - "title" : "Pet catehgry", - "description" : "A category for a pet", - "xml" : { - "name" : "Category" - } - }, - "User" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "username" : { - "type" : "string" - }, - "firstName" : { - "type" : "string" - }, - "lastName" : { - "type" : "string" - }, - "email" : { - "type" : "string" - }, - "password" : { - "type" : "string" - }, - "phone" : { - "type" : "string" - }, - "userStatus" : { - "type" : "integer", - "format" : "int32", - "description" : "User Status" - } - }, - "title" : "a User", - "description" : "A User who is purchasing from the pet store", - "xml" : { - "name" : "User" - } - }, - "Tag" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - } - }, - "title" : "Pet Tag", - "description" : "A tag for a pet", - "xml" : { - "name" : "Tag" - } - }, - "Pet" : { - "type" : "object", - "required" : [ "name", "photoUrls" ], - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "category" : { - "$ref" : "#/definitions/Category" - }, - "name" : { - "type" : "string", - "example" : "doggie" - }, - "photoUrls" : { - "type" : "array", - "xml" : { - "name" : "photoUrl", - "wrapped" : true - }, - "items" : { - "type" : "string" - } - }, - "tags" : { - "type" : "array", - "xml" : { - "name" : "tag", - "wrapped" : true - }, - "items" : { - "$ref" : "#/definitions/Tag" - } - }, - "status" : { - "type" : "string", - "description" : "pet status in the store", - "enum" : [ "available", "pending", "sold" ] - } - }, - "title" : "a Pet", - "description" : "A pet for sale in the pet store", - "xml" : { - "name" : "Pet" - } - }, - "ApiResponse" : { - "type" : "object", - "properties" : { - "code" : { - "type" : "integer", - "format" : "int32" - }, - "type" : { - "type" : "string" - }, - "message" : { - "type" : "string" - } - }, - "title" : "An uploaded response", - "description" : "Describes the result of uploading an image resource" - } - }, - "externalDocs" : { - "description" : "Find out more about Swagger", - "url" : "http://swagger.io" - } +{ + "swagger" : "2.0", + "info" : { + "description" : "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "version" : "1.0.0", + "title" : "Swagger Petstore", + "termsOfService" : "http://swagger.io/terms/", + "contact" : { + "email" : "apiteam@swagger.io" + }, + "license" : { + "name" : "Apache 2.0", + "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "host" : "petstore.swagger.io", + "basePath" : "/v2", + "tags" : [ { + "name" : "pet", + "description" : "Everything about your Pets", + "externalDocs" : { + "description" : "Find out more", + "url" : "http://swagger.io" + } + }, { + "name" : "store", + "description" : "Access to Petstore orders" + }, { + "name" : "user", + "description" : "Operations about user", + "externalDocs" : { + "description" : "Find out more about our store", + "url" : "http://swagger.io" + } + } ], + "schemes" : [ "http" ], + "paths" : { + "/pet" : { + "post" : { + "tags" : [ "pet" ], + "summary" : "Add a new pet to the store", + "description" : "", + "operationId" : "addPet", + "consumes" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Pet object that needs to be added to the store", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Pet" + } + } ], + "responses" : { + "405" : { + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + }, + "put" : { + "tags" : [ "pet" ], + "summary" : "Update an existing pet", + "description" : "", + "operationId" : "updatePet", + "consumes" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Pet object that needs to be added to the store", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Pet" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Pet not found" + }, + "405" : { + "description" : "Validation exception" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/pet/findByStatus" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Finds Pets by status", + "description" : "Multiple status values can be provided with comma separated strings", + "operationId" : "findPetsByStatus", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "status", + "in" : "query", + "description" : "Status values that need to be considered for filter", + "required" : true, + "type" : "array", + "items" : { + "type" : "string", + "default" : "available", + "enum" : [ "available", "pending", "sold" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Pet" + } + } + }, + "400" : { + "description" : "Invalid status value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/pet/findByTags" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Finds Pets by tags", + "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "operationId" : "findPetsByTags", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "tags", + "in" : "query", + "description" : "Tags to filter by", + "required" : true, + "type" : "array", + "items" : { + "type" : "string" + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Pet" + } + } + }, + "400" : { + "description" : "Invalid tag value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/pet/{petId}" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Find pet by ID", + "description" : "Returns a single pet", + "operationId" : "getPetById", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet to return", + "required" : true, + "type" : "integer", + "format" : "int64" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Pet" + } + }, + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Pet not found" + } + }, + "security" : [ { + "api_key" : [ ] + } ] + }, + "post" : { + "tags" : [ "pet" ], + "summary" : "Updates a pet in the store with form data", + "description" : "", + "operationId" : "updatePetWithForm", + "consumes" : [ "application/x-www-form-urlencoded" ], + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet that needs to be updated", + "required" : true, + "type" : "integer", + "format" : "int64" + }, { + "name" : "name", + "in" : "formData", + "description" : "Updated name of the pet", + "required" : false, + "type" : "string" + }, { + "name" : "status", + "in" : "formData", + "description" : "Updated status of the pet", + "required" : false, + "type" : "string" + } ], + "responses" : { + "405" : { + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + }, + "delete" : { + "tags" : [ "pet" ], + "summary" : "Deletes a pet", + "description" : "", + "operationId" : "deletePet", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "api_key", + "in" : "header", + "required" : false, + "type" : "string" + }, { + "name" : "petId", + "in" : "path", + "description" : "Pet id to delete", + "required" : true, + "type" : "integer", + "format" : "int64" + } ], + "responses" : { + "400" : { + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/pet/{petId}/uploadImage" : { + "post" : { + "tags" : [ "pet" ], + "summary" : "uploads an image", + "description" : "", + "operationId" : "uploadFile", + "consumes" : [ "multipart/form-data" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet to update", + "required" : true, + "type" : "integer", + "format" : "int64" + }, { + "name" : "additionalMetadata", + "in" : "formData", + "description" : "Additional data to pass to server", + "required" : false, + "type" : "string" + }, { + "name" : "file", + "in" : "formData", + "description" : "file to upload", + "required" : false, + "type" : "file" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ApiResponse" + } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/store/inventory" : { + "get" : { + "tags" : [ "store" ], + "summary" : "Returns pet inventories by status", + "description" : "Returns a map of status codes to quantities", + "operationId" : "getInventory", + "produces" : [ "application/json" ], + "parameters" : [ ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "integer", + "format" : "int32" + } + } + } + }, + "security" : [ { + "api_key" : [ ] + } ] + } + }, + "/store/order" : { + "post" : { + "tags" : [ "store" ], + "summary" : "Place an order for a pet", + "description" : "", + "operationId" : "placeOrder", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "order placed for purchasing the pet", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Order" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Order" + } + }, + "400" : { + "description" : "Invalid Order" + } + } + } + }, + "/store/order/{orderId}" : { + "get" : { + "tags" : [ "store" ], + "summary" : "Find purchase order by ID", + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "orderId", + "in" : "path", + "description" : "ID of pet that needs to be fetched", + "required" : true, + "type" : "integer", + "maximum" : 5, + "minimum" : 1, + "format" : "int64" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Order" + } + }, + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Order not found" + } + } + }, + "delete" : { + "tags" : [ "store" ], + "summary" : "Delete purchase order by ID", + "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + "operationId" : "deleteOrder", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "orderId", + "in" : "path", + "description" : "ID of the order that needs to be deleted", + "required" : true, + "type" : "string", + "minimum" : 1 + } ], + "responses" : { + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Order not found" + } + } + } + }, + "/user" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Create user", + "description" : "This can only be done by the logged in user.", + "operationId" : "createUser", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Created user object", + "required" : true, + "schema" : { + "$ref" : "#/definitions/User" + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/user/createWithArray" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Creates list of users with given input array", + "description" : "", + "operationId" : "createUsersWithArrayInput", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "List of user object", + "required" : true, + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/User" + } + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/user/createWithList" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Creates list of users with given input array", + "description" : "", + "operationId" : "createUsersWithListInput", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "List of user object", + "required" : true, + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/User" + } + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/user/login" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Logs user into the system", + "description" : "", + "operationId" : "loginUser", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "username", + "in" : "query", + "description" : "The user name for login", + "required" : true, + "type" : "string" + }, { + "name" : "password", + "in" : "query", + "description" : "The password for login in clear text", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "string" + }, + "headers" : { + "X-Rate-Limit" : { + "type" : "integer", + "format" : "int32", + "description" : "calls per hour allowed by the user" + }, + "X-Expires-After" : { + "type" : "string", + "format" : "date-time", + "description" : "date in UTC when toekn expires" + } + } + }, + "400" : { + "description" : "Invalid username/password supplied" + } + } + } + }, + "/user/logout" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Logs out current logged in user session", + "description" : "", + "operationId" : "logoutUser", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/user/{username}" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Get user by user name", + "description" : "", + "operationId" : "getUserByName", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The name that needs to be fetched. Use user1 for testing. ", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/User" + } + }, + "400" : { + "description" : "Invalid username supplied" + }, + "404" : { + "description" : "User not found" + } + } + }, + "put" : { + "tags" : [ "user" ], + "summary" : "Updated user", + "description" : "This can only be done by the logged in user.", + "operationId" : "updateUser", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "name that need to be deleted", + "required" : true, + "type" : "string" + }, { + "in" : "body", + "name" : "body", + "description" : "Updated user object", + "required" : true, + "schema" : { + "$ref" : "#/definitions/User" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid user supplied" + }, + "404" : { + "description" : "User not found" + } + } + }, + "delete" : { + "tags" : [ "user" ], + "summary" : "Delete user", + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The name that needs to be deleted", + "required" : true, + "type" : "string" + } ], + "responses" : { + "400" : { + "description" : "Invalid username supplied" + }, + "404" : { + "description" : "User not found" + } + } + } + } + }, + "securityDefinitions" : { + "petstore_auth" : { + "type" : "oauth2", + "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", + "flow" : "implicit", + "scopes" : { + "write:pets" : "modify pets in your account", + "read:pets" : "read your pets" + } + }, + "api_key" : { + "type" : "apiKey", + "name" : "api_key", + "in" : "header" + } + }, + "definitions" : { + "Order" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "petId" : { + "type" : "integer", + "format" : "int64" + }, + "quantity" : { + "type" : "integer", + "format" : "int32" + }, + "shipDate" : { + "type" : "string", + "format" : "date-time" + }, + "status" : { + "type" : "string", + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ] + }, + "complete" : { + "type" : "boolean", + "default" : false + } + }, + "title" : "Pet Order", + "description" : "An order for a pets from the pet store", + "xml" : { + "name" : "Order" + } + }, + "Category" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet catehgry", + "description" : "A category for a pet", + "xml" : { + "name" : "Category" + } + }, + "User" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "username" : { + "type" : "string" + }, + "firstName" : { + "type" : "string" + }, + "lastName" : { + "type" : "string" + }, + "email" : { + "type" : "string" + }, + "password" : { + "type" : "string" + }, + "phone" : { + "type" : "string" + }, + "userStatus" : { + "type" : "integer", + "format" : "int32", + "description" : "User Status" + } + }, + "title" : "a User", + "description" : "A User who is purchasing from the pet store", + "xml" : { + "name" : "User" + } + }, + "Tag" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet Tag", + "description" : "A tag for a pet", + "xml" : { + "name" : "Tag" + } + }, + "Pet" : { + "type" : "object", + "required" : [ "name", "photoUrls" ], + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "category" : { + "$ref" : "#/definitions/Category" + }, + "name" : { + "type" : "string", + "example" : "doggie" + }, + "photoUrls" : { + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + }, + "items" : { + "type" : "string" + } + }, + "tags" : { + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + }, + "items" : { + "$ref" : "#/definitions/Tag" + } + }, + "status" : { + "type" : "string", + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ] + } + }, + "title" : "a Pet", + "description" : "A pet for sale in the pet store", + "xml" : { + "name" : "Pet" + } + }, + "ApiResponse" : { + "type" : "object", + "properties" : { + "code" : { + "type" : "integer", + "format" : "int32" + }, + "type" : { + "type" : "string" + }, + "message" : { + "type" : "string" + } + }, + "title" : "An uploaded response", + "description" : "Describes the result of uploading an image resource" + } + }, + "externalDocs" : { + "description" : "Find out more about Swagger", + "url" : "http://swagger.io" + } } \ No newline at end of file From 59caedd31f4b1c476337e29973160ccf56b0af6b Mon Sep 17 00:00:00 2001 From: "J. Fiala" Date: Fri, 6 Jan 2017 17:44:05 +0100 Subject: [PATCH 09/23] add beanvalidation to jaxrs-cxf-cdi #4091 --- .../JavaJAXRSCXFCDIServerCodegen.java | 20 ++++++++++++++++++- .../resources/JavaJaxRS/cxf-cdi/api.mustache | 4 +++- .../JavaJaxRS/cxf-cdi/model.mustache | 4 +++- .../JavaJaxRS/cxf-cdi/pathParams.mustache | 2 +- .../resources/JavaJaxRS/cxf-cdi/pojo.mustache | 2 +- .../resources/JavaJaxRS/cxf-cdi/pom.mustache | 10 ++++++++++ .../JavaJaxRS/cxf-cdi/queryParams.mustache | 2 +- .../src/gen/java/io/swagger/api/PetApi.java | 5 +++-- .../src/gen/java/io/swagger/api/StoreApi.java | 5 +++-- .../src/gen/java/io/swagger/api/UserApi.java | 3 ++- .../gen/java/io/swagger/model/Category.java | 1 + .../io/swagger/model/ModelApiResponse.java | 1 + .../src/gen/java/io/swagger/model/Order.java | 1 + .../src/gen/java/io/swagger/model/Pet.java | 3 +++ .../src/gen/java/io/swagger/model/Tag.java | 1 + .../src/gen/java/io/swagger/model/User.java | 1 + 16 files changed, 54 insertions(+), 11 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java index be214dae514..b48559dd6a6 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java @@ -1,8 +1,10 @@ package io.swagger.codegen.languages; +import io.swagger.codegen.CliOption; import io.swagger.codegen.CodegenModel; import io.swagger.codegen.CodegenProperty; import io.swagger.codegen.SupportingFile; +import io.swagger.codegen.languages.features.BeanValidationFeatures; import java.io.File; @@ -13,7 +15,10 @@ * in /src/gen/java and a sample ServiceImpl in /src/main/java. The API uses CDI * to get an instance of ServiceImpl that implements the Service interface. */ -public class JavaJAXRSCXFCDIServerCodegen extends JavaJAXRSSpecServerCodegen { +public class JavaJAXRSCXFCDIServerCodegen extends JavaJAXRSSpecServerCodegen implements BeanValidationFeatures { + + protected boolean useBeanValidation = true; + /** * Default constructor */ @@ -32,6 +37,8 @@ public JavaJAXRSCXFCDIServerCodegen() { // Updated template directory embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME + File.separator + "cxf-cdi"; + + cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); } @Override @@ -43,6 +50,14 @@ public String getName() { public void processOpts() { super.processOpts(); + if (additionalProperties.containsKey(USE_BEANVALIDATION)) { + this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); + } + + if (useBeanValidation) { + writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + } + supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen // writeOptional means these files are only written if they don't already exist @@ -73,4 +88,7 @@ public String getHelp() { + "Apache CXF runtime and a Java EE runtime with CDI enabled."; } + public void setUseBeanValidation(boolean useBeanValidation) { + this.useBeanValidation = useBeanValidation; + } } 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 5fabe593164..e048e3982aa 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 @@ -16,7 +16,9 @@ import io.swagger.annotations.*; import org.apache.cxf.jaxrs.ext.multipart.Attachment; import java.util.List; - +{{#useBeanValidation}} +import javax.validation.constraints.*; +{{/useBeanValidation}} @Path("/{{baseName}}") @RequestScoped diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache index 2c383a41a28..225cfd719cc 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache @@ -2,7 +2,9 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} - +{{#useBeanValidation}} +import javax.validation.constraints.*; +{{/useBeanValidation}} {{#models}} {{#model}}{{#description}} /** diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pathParams.mustache index 8d80210b4b4..4e21dd6091e 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache index a62db41bd53..c3b9637c2fc 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache @@ -24,7 +24,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{#vendorExtensions.extraAnnotation}}{{{vendorExtensions.extraAnnotation}}}{{/vendorExtensions.extraAnnotation}} @ApiModelProperty({{#example}}example = "{{example}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") @JsonProperty("{{baseName}}") - public {{{datatypeWithEnum}}} {{getter}}() { +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; } public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache index a5a683b9748..508136322f2 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache @@ -76,6 +76,16 @@ swagger-annotations [1.5.3,2) + +{{#useBeanValidation}} + + + javax.validation + validation-api + 1.1.0.Final + provided + +{{/useBeanValidation}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/queryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/queryParams.mustache index 6bff4a4b82d..c1c9e8b45cb 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/queryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{#defaultValue}}@DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{#defaultValue}}@DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file 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 bca3172e139..9df8f1146bb 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 @@ -17,6 +17,7 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; import java.util.List; +import javax.validation.constraints.*; @Path("/pet") @RequestScoped @@ -77,7 +78,7 @@ public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @P @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") }) - public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="available, pending, sold") @QueryParam("status") List status) { + 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); } @@ -94,7 +95,7 @@ public Response findPetsByStatus(@ApiParam(value = "Status values that need to b @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") }) - public Response findPetsByTags(@ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags) { + public Response findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags) { return delegate.findPetsByTags(tags, 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 d84cd657303..13e71588f67 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 @@ -16,6 +16,7 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; import java.util.List; +import javax.validation.constraints.*; @Path("/store") @RequestScoped @@ -39,7 +40,7 @@ public class StoreApi { @ApiResponses(value = { @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) { + public Response deleteOrder( @Min(1)@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("orderId") String orderId) { return delegate.deleteOrder(orderId, securityContext); } @@ -65,7 +66,7 @@ public Response getInventory() { @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) }) - public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") Long orderId) { + 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); } 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 98394e3b82e..faf2d5143db 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 @@ -16,6 +16,7 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; import java.util.List; +import javax.validation.constraints.*; @Path("/user") @RequestScoped @@ -97,7 +98,7 @@ public Response getUserByName(@ApiParam(value = "The name that needs to be fetch @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.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) { + 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); } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java index 5c941a3a15b..5a429766b3a 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; /** * A category for a pet diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java index 1424e1d4d37..2b65185e9cf 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; /** * Describes the result of uploading an image resource diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java index 450d8606bf4..5fede18f8dc 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; /** * An order for a pets from the pet store diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java index 357b3f0e23c..0b46bc38e7b 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java @@ -7,6 +7,7 @@ import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; +import javax.validation.constraints.*; /** * A pet for sale in the pet store @@ -86,6 +87,7 @@ public Pet name(String name) { @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") + @NotNull public String getName() { return name; } @@ -103,6 +105,7 @@ public Pet photoUrls(List photoUrls) { @ApiModelProperty(example = "null", required = true, value = "") @JsonProperty("photoUrls") + @NotNull public List getPhotoUrls() { return photoUrls; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java index 78b9a6b0a5b..d8574a58e13 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; /** * A tag for a pet diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java index 62b05c0cd43..5bc2c4e5002 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; /** * A User who is purchasing from the pet store From 4cc5b0b3c717badb0243bd2016b9321b29bd4641 Mon Sep 17 00:00:00 2001 From: "J. Fiala" Date: Fri, 6 Jan 2017 17:46:46 +0100 Subject: [PATCH 10/23] add beanvalidation to jaxrs-cxf-cdi #4091 --- .../JavaJaxRS/cxf-cdi/beanValidation.mustache | 53 +++++++++++++++++++ .../cxf-cdi/beanValidationPathParams.mustache | 1 + .../beanValidationQueryParams.mustache | 1 + 3 files changed, 55 insertions(+) create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidation.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationPathParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationQueryParams.mustache diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidation.mustache new file mode 100644 index 00000000000..079eab89d1a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidation.mustache @@ -0,0 +1,53 @@ +{{#required}} + @NotNull +{{/required}} +{{#pattern}} + @Pattern(regexp="{{pattern}}") +{{/pattern}} +{{#minLength}} +{{#maxLength}} + @Size(min={{minLength}},max={{maxLength}}) +{{/maxLength}} +{{/minLength}} +{{#minLength}} +{{^maxLength}} + @Size(min={{minLength}}) +{{/maxLength}} +{{/minLength}} +{{^minLength}} +{{#maxLength}} + @Size(max={{maxLength}}) + {{/maxLength}} + {{/minLength}} +{{#minItems}} +{{#maxItems}} + @Size(min={{minItems}},max={{maxItems}}) +{{/maxItems}} +{{/minItems}} +{{#minItems}} +{{^maxItems}} + @Size(min={{minItems}}) +{{/maxItems}} +{{/minItems}} +{{^minItems}} +{{#maxItems}} + @Size(max={{maxItems}}) +{{/maxItems}} +{{/minItems}} +{{! check for integer / number=decimal type}} +{{#isInteger}} +{{#minimum}} + @Min({{minimum}}) +{{/minimum}} +{{#maximum}} + @Max({{maximum}}) +{{/maximum}} +{{/isInteger}} +{{^isInteger}} +{{#minimum}} + @DecimalMin("{{minimum}}") +{{/minimum}} +{{#maximum}} + @DecimalMax("{{maximum}}") +{{/maximum}} +{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationPathParams.mustache new file mode 100644 index 00000000000..e3060fa6c6a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationPathParams.mustache @@ -0,0 +1 @@ +{{! PathParam is always required, no @NotNull necessary }}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationQueryParams.mustache new file mode 100644 index 00000000000..52440b12218 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationQueryParams.mustache @@ -0,0 +1 @@ +{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file From bff8231bb44179e48d40d7a6bee43b496d3040b2 Mon Sep 17 00:00:00 2001 From: "J. Fiala" Date: Fri, 6 Jan 2017 17:47:43 +0100 Subject: [PATCH 11/23] update crlf --- .../jaxrs-cxf-cdi/.swagger-codegen-ignore | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen-ignore b/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen-ignore index f21535fd6e9..c5fa491b4c5 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen-ignore +++ b/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen-ignore @@ -1,23 +1,23 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md From 7ab67ae4115bb5a1ac3cef555c75f2579fec5c8f Mon Sep 17 00:00:00 2001 From: "J. Fiala" Date: Tue, 10 Jan 2017 18:02:23 +0100 Subject: [PATCH 12/23] replace tabs --- .../languages/JavaJAXRSCXFCDIServerCodegen.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java index b48559dd6a6..d3895532f76 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java @@ -16,9 +16,9 @@ * to get an instance of ServiceImpl that implements the Service interface. */ public class JavaJAXRSCXFCDIServerCodegen extends JavaJAXRSSpecServerCodegen implements BeanValidationFeatures { - - protected boolean useBeanValidation = true; - + + protected boolean useBeanValidation = true; + /** * Default constructor */ @@ -51,12 +51,12 @@ public void processOpts() { super.processOpts(); if (additionalProperties.containsKey(USE_BEANVALIDATION)) { - this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); + this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); } - if (useBeanValidation) { - writePropertyBack(USE_BEANVALIDATION, useBeanValidation); - } + if (useBeanValidation) { + writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + } supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen From 35e0c0ee823e9b4e67eb49c314064ce91d7aea14 Mon Sep 17 00:00:00 2001 From: Johannes Fiala Date: Thu, 19 Jan 2017 21:01:46 +0100 Subject: [PATCH 13/23] re-generate samples after rebasing #4091 --- .../src/gen/java/io/swagger/api/PetApi.java | 336 ++-- .../java/io/swagger/api/PetApiService.java | 57 +- .../src/gen/java/io/swagger/api/StoreApi.java | 168 +- .../java/io/swagger/api/StoreApiService.java | 48 +- .../src/gen/java/io/swagger/api/UserApi.java | 254 +-- .../gen/java/io/swagger/model/Category.java | 188 +- .../src/gen/java/io/swagger/model/Order.java | 384 ++-- .../src/gen/java/io/swagger/model/Pet.java | 396 ++-- .../src/gen/java/io/swagger/model/Tag.java | 188 +- .../src/gen/java/io/swagger/model/User.java | 430 +++-- .../swagger/api/impl/PetApiServiceImpl.java | 125 +- .../swagger/api/impl/StoreApiServiceImpl.java | 84 +- .../petstore/jaxrs-cxf-cdi/swagger.json | 1597 ++++++++--------- .../src/gen/java/io/swagger/api/FakeApi.java | 60 + .../model/AdditionalPropertiesClass.java | 90 + .../src/gen/java/io/swagger/model/Animal.java | 89 + .../gen/java/io/swagger/model/AnimalFarm.java | 53 + .../model/ArrayOfArrayOfNumberOnly.java | 71 + .../io/swagger/model/ArrayOfNumberOnly.java | 71 + .../gen/java/io/swagger/model/ArrayTest.java | 109 ++ .../src/gen/java/io/swagger/model/Cat.java | 69 + .../gen/java/io/swagger/model/ClassModel.java | 72 + .../src/gen/java/io/swagger/model/Client.java | 68 + .../src/gen/java/io/swagger/model/Dog.java | 69 + .../gen/java/io/swagger/model/EnumArrays.java | 140 ++ .../gen/java/io/swagger/model/EnumClass.java | 21 + .../gen/java/io/swagger/model/EnumTest.java | 177 ++ .../gen/java/io/swagger/model/FormatTest.java | 308 ++++ .../io/swagger/model/HasOnlyReadOnly.java | 87 + .../gen/java/io/swagger/model/MapTest.java | 124 ++ ...ropertiesAndAdditionalPropertiesClass.java | 110 ++ .../io/swagger/model/Model200Response.java | 91 + .../java/io/swagger/model/ModelReturn.java | 72 + .../src/gen/java/io/swagger/model/Name.java | 129 ++ .../gen/java/io/swagger/model/NumberOnly.java | 69 + .../gen/java/io/swagger/model/OuterEnum.java | 21 + .../java/io/swagger/model/ReadOnlyFirst.java | 87 + .../io/swagger/model/SpecialModelName.java | 68 + 38 files changed, 4412 insertions(+), 2168 deletions(-) create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java 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 9df8f1146bb..451c0bf74e7 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 @@ -1,166 +1,170 @@ -package io.swagger.api; - -import java.io.File; -import io.swagger.model.ModelApiResponse; -import io.swagger.model.Pet; -import io.swagger.api.PetApiService; - -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; - -import io.swagger.annotations.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.List; -import javax.validation.constraints.*; -@Path("/pet") -@RequestScoped - -@Api(description = "the pet API") - - - - -public class PetApi { - - @Context SecurityContext securityContext; - - @Inject PetApiService delegate; - - - @POST - - @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Add a new pet to the store", notes = "", response = void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) - public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { - return delegate.addPet(body, securityContext); - } - - @DELETE - @Path("/{petId}") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Deletes a pet", notes = "", response = void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid pet value", response = void.class) }) - 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); - } - - @GET - @Path("/findByStatus") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) - 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); - } - - @GET - @Path("/findByTags") - - @Produces({ "application/xml", "application/json" }) - @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 = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) - public Response findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags) { - return delegate.findPetsByTags(tags, securityContext); - } - - @GET - @Path("/{petId}") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, 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) }) - public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId) { - return delegate.getPetById(petId, securityContext); - } - - @PUT - - @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Update an existing pet", notes = "", response = void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), - @ApiResponse(code = 404, message = "Pet not found", response = void.class), - @ApiResponse(code = 405, message = "Validation exception", response = void.class) }) - public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { - return delegate.updatePet(body, securityContext); - } - - @POST - @Path("/{petId}") - @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) - 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); - } - - @POST - @Path("/{petId}/uploadImage") - @Consumes({ "multipart/form-data" }) - @Produces({ "application/json" }) - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file", required = false) InputStream fileInputStream, @Multipart(value = "file" , required = false) Attachment fileDetail) { - return delegate.uploadFile(petId, additionalMetadata, inputStream, fileDetail, securityContext); - } -} +package io.swagger.api; + +import java.io.File; +import io.swagger.model.Pet; +import io.swagger.api.PetApiService; + +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; + +import io.swagger.annotations.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; + +import java.util.List; +import javax.validation.constraints.*; +@Path("/pet") +@RequestScoped + +@Api(description = "the pet API") + + + + +public class PetApi { + + @Context SecurityContext securityContext; + + @Inject PetApiService delegate; + + + @POST + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/json", "application/xml" }) + @ApiOperation(value = "Add a new pet to the store", notes = "", response = void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ) Pet body) { + return delegate.addPet(body, securityContext); + } + + @DELETE + @Path("/{petId}") + + @Produces({ "application/json", "application/xml" }) + @ApiOperation(value = "Deletes a pet", notes = "", response = void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid pet value", response = void.class) }) + 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); + } + + @GET + @Path("/findByStatus") + + @Produces({ "application/json", "application/xml" }) + @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + public Response findPetsByStatus( @ApiParam(value = "Status values that need to be considered for filter", allowableValues="available, pending, sold", defaultValue="available") @DefaultValue("available") @QueryParam("status") List status) { + return delegate.findPetsByStatus(status, securityContext); + } + + @GET + @Path("/findByTags") + + @Produces({ "application/json", "application/xml" }) + @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 = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + public Response findPetsByTags( @ApiParam(value = "Tags to filter by") @QueryParam("tags") List tags) { + return delegate.findPetsByTags(tags, securityContext); + } + + @GET + @Path("/{petId}") + + @Produces({ "application/json", "application/xml" }) + @ApiOperation(value = "Find pet by ID", notes = "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions", response = Pet.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }), + @Authorization(value = "api_key") + }, 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) }) + public Response getPetById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("petId") Long petId) { + return delegate.getPetById(petId, securityContext); + } + + @PUT + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/json", "application/xml" }) + @ApiOperation(value = "Update an existing pet", notes = "", response = void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), + @ApiResponse(code = 404, message = "Pet not found", response = void.class), + @ApiResponse(code = 405, message = "Validation exception", response = void.class) }) + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ) Pet body) { + return delegate.updatePet(body, securityContext); + } + + @POST + @Path("/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + @Produces({ "application/json", "application/xml" }) + @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) + public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") String petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status) { + return delegate.updatePetWithForm(petId, name, status, securityContext); + } + + @POST + @Path("/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json", "application/xml" }) + @ApiOperation(value = "uploads an image", notes = "", response = void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = void.class) }) + public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file", required = false) InputStream fileInputStream, @Multipart(value = "file" , required = false) Attachment fileDetail) { + return delegate.uploadFile(petId, additionalMetadata, inputStream, fileDetail, securityContext); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java index 0ed0a9da2ce..3e1aa1e456e 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java @@ -1,29 +1,28 @@ -package io.swagger.api; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.io.File; -import io.swagger.model.ModelApiResponse; -import io.swagger.model.Pet; - -import java.util.List; - -import java.io.InputStream; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - - -public interface PetApiService { - public Response addPet(Pet body, SecurityContext securityContext); - public Response deletePet(Long petId, String apiKey, SecurityContext securityContext); - public Response findPetsByStatus(List status, SecurityContext securityContext); - public Response findPetsByTags(List tags, SecurityContext securityContext); - public Response getPetById(Long petId, SecurityContext securityContext); - public Response updatePet(Pet body, SecurityContext securityContext); - public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext); - public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, Attachment fileDetail, SecurityContext securityContext); -} +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.io.File; +import io.swagger.model.Pet; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public interface PetApiService { + public Response addPet(Pet body, SecurityContext securityContext); + public Response deletePet(Long petId, String apiKey, SecurityContext securityContext); + public Response findPetsByStatus(List status, SecurityContext securityContext); + public Response findPetsByTags(List tags, SecurityContext securityContext); + public Response getPetById(Long petId, SecurityContext securityContext); + public Response updatePet(Pet body, SecurityContext securityContext); + public Response updatePetWithForm(String petId, String name, String status, SecurityContext securityContext); + public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, Attachment fileDetail, SecurityContext 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 13e71588f67..fa05d9c443e 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 @@ -1,84 +1,84 @@ -package io.swagger.api; - -import java.util.Map; -import io.swagger.model.Order; -import io.swagger.api.StoreApiService; - -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; - -import io.swagger.annotations.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.List; -import javax.validation.constraints.*; -@Path("/store") -@RequestScoped - -@Api(description = "the store API") - - - - -public class StoreApi { - - @Context SecurityContext securityContext; - - @Inject StoreApiService delegate; - - - @DELETE - @Path("/order/{orderId}") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = void.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), - @ApiResponse(code = 404, message = "Order not found", response = void.class) }) - public Response deleteOrder( @Min(1)@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("orderId") String orderId) { - return delegate.deleteOrder(orderId, securityContext); - } - - @GET - @Path("/inventory") - - @Produces({ "application/json" }) - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { - @Authorization(value = "api_key") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) - public Response getInventory() { - return delegate.getInventory(securityContext); - } - - @GET - @Path("/order/{orderId}") - - @Produces({ "application/xml", "application/json" }) - @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) }) - 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); - } - - @POST - @Path("/order") - - @Produces({ "application/xml", "application/json" }) - @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) }) - public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body) { - return delegate.placeOrder(body, securityContext); - } -} +package io.swagger.api; + +import java.util.Map; +import io.swagger.model.Order; +import io.swagger.api.StoreApiService; + +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; + +import io.swagger.annotations.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.List; +import javax.validation.constraints.*; +@Path("/store") +@RequestScoped + +@Api(description = "the store API") + + + + +public class StoreApi { + + @Context SecurityContext securityContext; + + @Inject StoreApiService delegate; + + + @DELETE + @Path("/order/{orderId}") + + @Produces({ "application/json", "application/xml" }) + @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) }) + 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); + } + + @GET + @Path("/inventory") + + @Produces({ "application/json", "application/xml" }) + @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @Authorization(value = "api_key") + }, tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + public Response getInventory() { + return delegate.getInventory(securityContext); + } + + @GET + @Path("/order/{orderId}") + + @Produces({ "application/json", "application/xml" }) + @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) }) + public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") String orderId) { + return delegate.getOrderById(orderId, securityContext); + } + + @POST + @Path("/order") + + @Produces({ "application/json", "application/xml" }) + @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) }) + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ) Order body) { + return delegate.placeOrder(body, securityContext); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java index 962f3e16965..584fdd92ba6 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java @@ -1,24 +1,24 @@ -package io.swagger.api; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.Map; -import io.swagger.model.Order; - -import java.util.List; - -import java.io.InputStream; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - - -public interface StoreApiService { - public Response deleteOrder(String orderId, SecurityContext securityContext); - public Response getInventory(SecurityContext securityContext); - public Response getOrderById(Long orderId, SecurityContext securityContext); - public Response placeOrder(Order body, SecurityContext securityContext); -} +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public interface StoreApiService { + public Response deleteOrder(String orderId, SecurityContext securityContext); + public Response getInventory(SecurityContext securityContext); + public Response getOrderById(String orderId, SecurityContext securityContext); + public Response placeOrder(Order body, SecurityContext 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 faf2d5143db..052d85fd5e2 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 @@ -1,127 +1,127 @@ -package io.swagger.api; - -import java.util.List; -import io.swagger.model.User; -import io.swagger.api.UserApiService; - -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; - -import io.swagger.annotations.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.List; -import javax.validation.constraints.*; -@Path("/user") -@RequestScoped - -@Api(description = "the user API") - - - - -public class UserApi { - - @Context SecurityContext securityContext; - - @Inject UserApiService delegate; - - - @POST - - - @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) }) - public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body) { - return delegate.createUser(body, securityContext); - } - - @POST - @Path("/createWithArray") - - @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) }) - public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body) { - return delegate.createUsersWithArrayInput(body, securityContext); - } - - @POST - @Path("/createWithList") - - @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) }) - public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body) { - return delegate.createUsersWithListInput(body, securityContext); - } - - @DELETE - @Path("/{username}") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user", }) - @ApiResponses(value = { - @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); - } - - @GET - @Path("/{username}") - - @Produces({ "application/xml", "application/json" }) - @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) }) - 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); - } - - @GET - @Path("/login") - - @Produces({ "application/xml", "application/json" }) - @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) }) - 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); - } - - @GET - @Path("/logout") - - @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) }) - public Response logoutUser() { - return delegate.logoutUser(securityContext); - } - - @PUT - @Path("/{username}") - - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = void.class, tags={ "user" }) - @ApiResponses(value = { - @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); - } -} +package io.swagger.api; + +import java.util.List; +import io.swagger.model.User; +import io.swagger.api.UserApiService; + +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; + +import io.swagger.annotations.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.List; +import javax.validation.constraints.*; +@Path("/user") +@RequestScoped + +@Api(description = "the user API") + + + + +public class UserApi { + + @Context SecurityContext securityContext; + + @Inject UserApiService delegate; + + + @POST + + + @Produces({ "application/json", "application/xml" }) + @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) }) + public Response createUser(@ApiParam(value = "Created user object" ) User body) { + return delegate.createUser(body, securityContext); + } + + @POST + @Path("/createWithArray") + + @Produces({ "application/json", "application/xml" }) + @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) }) + public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ) List body) { + return delegate.createUsersWithArrayInput(body, securityContext); + } + + @POST + @Path("/createWithList") + + @Produces({ "application/json", "application/xml" }) + @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) }) + public Response createUsersWithListInput(@ApiParam(value = "List of user object" ) List body) { + return delegate.createUsersWithListInput(body, securityContext); + } + + @DELETE + @Path("/{username}") + + @Produces({ "application/json", "application/xml" }) + @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) }) + public Response deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathParam("username") String username) { + return delegate.deleteUser(username, securityContext); + } + + @GET + @Path("/{username}") + + @Produces({ "application/json", "application/xml" }) + @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) }) + 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); + } + + @GET + @Path("/login") + + @Produces({ "application/json", "application/xml" }) + @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) }) + public Response loginUser( @ApiParam(value = "The user name for login") @QueryParam("username") String username, @ApiParam(value = "The password for login in clear text") @QueryParam("password") String password) { + return delegate.loginUser(username, password, securityContext); + } + + @GET + @Path("/logout") + + @Produces({ "application/json", "application/xml" }) + @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) }) + public Response logoutUser() { + return delegate.logoutUser(securityContext); + } + + @PUT + @Path("/{username}") + + @Produces({ "application/json", "application/xml" }) + @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) }) + public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username, @ApiParam(value = "Updated user object" ) User body) { + return delegate.updateUser(username, body, securityContext); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java index 5a429766b3a..c9c83bea176 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java @@ -1,96 +1,92 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import javax.validation.constraints.*; - -/** - * A category for a pet - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "A category for a pet") - -public class Category { - - private Long id = null; - private String name = null; - - /** - **/ - public Category id(Long id) { - this.id = id; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - public Category name(String name) { - this.name = name; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(id, category.id) && - Objects.equals(name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import javax.validation.constraints.*; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class Category { + + private Long id = null; + private String name = null; + + /** + **/ + public Category id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Category name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(id, category.id) && + Objects.equals(name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java index 5fede18f8dc..467f81f68da 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java @@ -1,194 +1,190 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import javax.validation.constraints.*; - -/** - * An order for a pets from the pet store - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "An order for a pets from the pet store") - -public class Order { - - private Long id = null; - private Long petId = null; - private Integer quantity = null; - private java.util.Date shipDate = null; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name="Order") -@XmlEnum -public enum Order { - {values=[placed, approved, delivered], enumVars=[{name=PLACED, value="placed"}, {name=APPROVED, value="approved"}, {name=DELIVERED, value="delivered"}]}, - - public String value() { - return name(); - } - - public static Order fromValue(String v) { - return valueOf(v); - } -} - private StatusEnum status = null; - private Boolean complete = false; - - /** - **/ - public Order id(Long id) { - this.id = id; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("petId") - public Long getPetId() { - return petId; - } - public void setPetId(Long petId) { - this.petId = petId; - } - - /** - **/ - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("quantity") - public Integer getQuantity() { - return quantity; - } - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - /** - **/ - public Order shipDate(java.util.Date shipDate) { - this.shipDate = shipDate; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("shipDate") - public java.util.Date getShipDate() { - return shipDate; - } - public void setShipDate(java.util.Date shipDate) { - this.shipDate = shipDate; - } - - /** - * Order Status - **/ - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - - @ApiModelProperty(example = "null", value = "Order Status") - @JsonProperty("status") - public StatusEnum getStatus() { - return status; - } - public void setStatus(StatusEnum status) { - this.status = status; - } - - /** - **/ - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("complete") - public Boolean getComplete() { - return complete; - } - public void setComplete(Boolean complete) { - this.complete = complete; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(id, order.id) && - Objects.equals(petId, order.petId) && - Objects.equals(quantity, order.quantity) && - Objects.equals(shipDate, order.shipDate) && - Objects.equals(status, order.status) && - Objects.equals(complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import javax.validation.constraints.*; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class Order { + + private Long id = null; + private Long petId = null; + private Integer quantity = null; + private java.util.Date shipDate = null; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="Order") +@XmlEnum +public enum Order { + {values=[placed, approved, delivered], enumVars=[{name=PLACED, value="placed"}, {name=APPROVED, value="approved"}, {name=DELIVERED, value="delivered"}]}, + + public String value() { + return name(); + } + + public static Order fromValue(String v) { + return valueOf(v); + } +} + private StatusEnum status = null; + private Boolean complete = null; + + /** + **/ + public Order id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + public void setPetId(Long petId) { + this.petId = petId; + } + + /** + **/ + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + /** + **/ + public Order shipDate(java.util.Date shipDate) { + this.shipDate = shipDate; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("shipDate") + public java.util.Date getShipDate() { + return shipDate; + } + public void setShipDate(java.util.Date shipDate) { + this.shipDate = shipDate; + } + + /** + * Order Status + **/ + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + + @ApiModelProperty(example = "null", value = "Order Status") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + **/ + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("complete") + public Boolean getComplete() { + return complete; + } + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(id, order.id) && + Objects.equals(petId, order.petId) && + Objects.equals(quantity, order.quantity) && + Objects.equals(shipDate, order.shipDate) && + Objects.equals(status, order.status) && + Objects.equals(complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java index 0b46bc38e7b..03b661f947d 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java @@ -1,200 +1,196 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.model.Category; -import io.swagger.model.Tag; -import java.util.ArrayList; -import java.util.List; -import javax.validation.constraints.*; - -/** - * A pet for sale in the pet store - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "A pet for sale in the pet store") - -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(); - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name="Pet") -@XmlEnum -public enum Pet { - {values=[available, pending, sold], enumVars=[{name=AVAILABLE, value="available"}, {name=PENDING, value="pending"}, {name=SOLD, value="sold"}]}, - - public String value() { - return name(); - } - - public static Pet fromValue(String v) { - return valueOf(v); - } -} - private StatusEnum status = null; - - /** - **/ - public Pet id(Long id) { - this.id = id; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - public Pet category(Category category) { - this.category = category; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("category") - public Category getCategory() { - return category; - } - public void setCategory(Category category) { - this.category = category; - } - - /** - **/ - public Pet name(String name) { - this.name = name; - return this; - } - - - @ApiModelProperty(example = "doggie", required = true, value = "") - @JsonProperty("name") - @NotNull - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - /** - **/ - public Pet photoUrls(List photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - - @ApiModelProperty(example = "null", required = true, value = "") - @JsonProperty("photoUrls") - @NotNull - public List getPhotoUrls() { - return photoUrls; - } - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } - - /** - **/ - public Pet tags(List tags) { - this.tags = tags; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("tags") - public List getTags() { - return tags; - } - public void setTags(List tags) { - this.tags = tags; - } - - /** - * pet status in the store - **/ - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - - @ApiModelProperty(example = "null", value = "pet status in the store") - @JsonProperty("status") - public StatusEnum getStatus() { - return status; - } - public void setStatus(StatusEnum status) { - this.status = status; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(id, pet.id) && - Objects.equals(category, pet.category) && - Objects.equals(name, pet.name) && - Objects.equals(photoUrls, pet.photoUrls) && - Objects.equals(tags, pet.tags) && - Objects.equals(status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.model.Category; +import io.swagger.model.Tag; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +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(); + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="Pet") +@XmlEnum +public enum Pet { + {values=[available, pending, sold], enumVars=[{name=AVAILABLE, value="available"}, {name=PENDING, value="pending"}, {name=SOLD, value="sold"}]}, + + public String value() { + return name(); + } + + public static Pet fromValue(String v) { + return valueOf(v); + } +} + private StatusEnum status = null; + + /** + **/ + public Pet id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Pet category(Category category) { + this.category = category; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("category") + public Category getCategory() { + return category; + } + public void setCategory(Category category) { + this.category = category; + } + + /** + **/ + public Pet name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") + @NotNull + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + /** + **/ + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { + return photoUrls; + } + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + /** + **/ + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("tags") + public List getTags() { + return tags; + } + public void setTags(List tags) { + this.tags = tags; + } + + /** + * pet status in the store + **/ + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + + @ApiModelProperty(example = "null", value = "pet status in the store") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(id, pet.id) && + Objects.equals(category, pet.category) && + Objects.equals(name, pet.name) && + Objects.equals(photoUrls, pet.photoUrls) && + Objects.equals(tags, pet.tags) && + Objects.equals(status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java index d8574a58e13..f3d7c9108cb 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java @@ -1,96 +1,92 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import javax.validation.constraints.*; - -/** - * A tag for a pet - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "A tag for a pet") - -public class Tag { - - private Long id = null; - private String name = null; - - /** - **/ - public Tag id(Long id) { - this.id = id; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - public Tag name(String name) { - this.name = name; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(id, tag.id) && - Objects.equals(name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import javax.validation.constraints.*; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class Tag { + + private Long id = null; + private String name = null; + + /** + **/ + public Tag id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Tag name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(id, tag.id) && + Objects.equals(name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java index 5bc2c4e5002..3e3802e1d43 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java @@ -1,217 +1,213 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import javax.validation.constraints.*; - -/** - * A User who is purchasing from the pet store - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "A User who is purchasing from the pet store") - -public class User { - - private Long id = null; - private String username = null; - private String firstName = null; - private String lastName = null; - private String email = null; - private String password = null; - private String phone = null; - private Integer userStatus = null; - - /** - **/ - public User id(Long id) { - this.id = id; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - public User username(String username) { - this.username = username; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("username") - public String getUsername() { - return username; - } - public void setUsername(String username) { - this.username = username; - } - - /** - **/ - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("firstName") - public String getFirstName() { - return firstName; - } - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - /** - **/ - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("lastName") - public String getLastName() { - return lastName; - } - public void setLastName(String lastName) { - this.lastName = lastName; - } - - /** - **/ - public User email(String email) { - this.email = email; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("email") - public String getEmail() { - return email; - } - public void setEmail(String email) { - this.email = email; - } - - /** - **/ - public User password(String password) { - this.password = password; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("password") - public String getPassword() { - return password; - } - public void setPassword(String password) { - this.password = password; - } - - /** - **/ - public User phone(String phone) { - this.phone = phone; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("phone") - public String getPhone() { - return phone; - } - public void setPhone(String phone) { - this.phone = phone; - } - - /** - * User Status - **/ - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - - @ApiModelProperty(example = "null", value = "User Status") - @JsonProperty("userStatus") - public Integer getUserStatus() { - return userStatus; - } - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(id, user.id) && - Objects.equals(username, user.username) && - Objects.equals(firstName, user.firstName) && - Objects.equals(lastName, user.lastName) && - Objects.equals(email, user.email) && - Objects.equals(password, user.password) && - Objects.equals(phone, user.phone) && - Objects.equals(userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import javax.validation.constraints.*; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class User { + + private Long id = null; + private String username = null; + private String firstName = null; + private String lastName = null; + private String email = null; + private String password = null; + private String phone = null; + private Integer userStatus = null; + + /** + **/ + public User id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public User username(String username) { + this.username = username; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("username") + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + /** + **/ + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + **/ + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + **/ + public User email(String email) { + this.email = email; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("email") + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + /** + **/ + public User password(String password) { + this.password = password; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("password") + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + /** + **/ + public User phone(String phone) { + this.phone = phone; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("phone") + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + + /** + * User Status + **/ + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + + @ApiModelProperty(example = "null", value = "User Status") + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(id, user.id) && + Objects.equals(username, user.username) && + Objects.equals(firstName, user.firstName) && + Objects.equals(lastName, user.lastName) && + Objects.equals(email, user.email) && + Objects.equals(password, user.password) && + Objects.equals(phone, user.phone) && + Objects.equals(userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index 171bdabcb05..a07852937ab 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -1,63 +1,62 @@ -package io.swagger.api.impl; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.io.File; -import io.swagger.model.ModelApiResponse; -import io.swagger.model.Pet; - -import java.util.List; - -import java.io.InputStream; - -import javax.enterprise.context.RequestScoped; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@RequestScoped - -public class PetApiServiceImpl implements PetApiService { - @Override - public Response addPet(Pet body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response deletePet(Long petId, String apiKey, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response findPetsByStatus(List status, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response findPetsByTags(List tags, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response getPetById(Long petId, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response updatePet(Pet body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, Attachment fileDetail, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } -} +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.io.File; +import io.swagger.model.Pet; + +import java.util.List; + +import java.io.InputStream; + +import javax.enterprise.context.RequestScoped; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@RequestScoped + +public class PetApiServiceImpl implements PetApiService { + @Override + public Response addPet(Pet body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response deletePet(Long petId, String apiKey, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response findPetsByStatus(List status, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response findPetsByTags(List tags, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response getPetById(Long petId, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response updatePet(Pet body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response updatePetWithForm(String petId, String name, String status, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, Attachment fileDetail, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 9463e955569..85f5fa94123 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -1,42 +1,42 @@ -package io.swagger.api.impl; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.Map; -import io.swagger.model.Order; - -import java.util.List; - -import java.io.InputStream; - -import javax.enterprise.context.RequestScoped; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@RequestScoped - -public class StoreApiServiceImpl implements StoreApiService { - @Override - public Response deleteOrder(String orderId, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response getInventory(SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response getOrderById(Long orderId, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response placeOrder(Order body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } -} +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; + +import java.io.InputStream; + +import javax.enterprise.context.RequestScoped; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@RequestScoped + +public class StoreApiServiceImpl implements StoreApiService { + @Override + public Response deleteOrder(String orderId, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response getInventory(SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response getOrderById(String orderId, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response placeOrder(Order body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json index a3adac3d4ac..fd1df5a86d1 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json +++ b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json @@ -1,831 +1,768 @@ -{ - "swagger" : "2.0", - "info" : { - "description" : "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", - "version" : "1.0.0", - "title" : "Swagger Petstore", - "termsOfService" : "http://swagger.io/terms/", - "contact" : { - "email" : "apiteam@swagger.io" - }, - "license" : { - "name" : "Apache 2.0", - "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" - } - }, - "host" : "petstore.swagger.io", - "basePath" : "/v2", - "tags" : [ { - "name" : "pet", - "description" : "Everything about your Pets", - "externalDocs" : { - "description" : "Find out more", - "url" : "http://swagger.io" - } - }, { - "name" : "store", - "description" : "Access to Petstore orders" - }, { - "name" : "user", - "description" : "Operations about user", - "externalDocs" : { - "description" : "Find out more about our store", - "url" : "http://swagger.io" - } - } ], - "schemes" : [ "http" ], - "paths" : { - "/pet" : { - "post" : { - "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "description" : "", - "operationId" : "addPet", - "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Pet object that needs to be added to the store", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Pet" - } - } ], - "responses" : { - "405" : { - "description" : "Invalid input" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - }, - "put" : { - "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "description" : "", - "operationId" : "updatePet", - "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Pet object that needs to be added to the store", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Pet" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" - }, - "405" : { - "description" : "Validation exception" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - } - }, - "/pet/findByStatus" : { - "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by status", - "description" : "Multiple status values can be provided with comma separated strings", - "operationId" : "findPetsByStatus", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "status", - "in" : "query", - "description" : "Status values that need to be considered for filter", - "required" : true, - "type" : "array", - "items" : { - "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] - }, - "collectionFormat" : "csv" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" - } - } - }, - "400" : { - "description" : "Invalid status value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - } - }, - "/pet/findByTags" : { - "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by tags", - "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - "operationId" : "findPetsByTags", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "tags", - "in" : "query", - "description" : "Tags to filter by", - "required" : true, - "type" : "array", - "items" : { - "type" : "string" - }, - "collectionFormat" : "csv" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" - } - } - }, - "400" : { - "description" : "Invalid tag value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - } - }, - "/pet/{petId}" : { - "get" : { - "tags" : [ "pet" ], - "summary" : "Find pet by ID", - "description" : "Returns a single pet", - "operationId" : "getPetById", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "petId", - "in" : "path", - "description" : "ID of pet to return", - "required" : true, - "type" : "integer", - "format" : "int64" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Pet" - } - }, - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" - } - }, - "security" : [ { - "api_key" : [ ] - } ] - }, - "post" : { - "tags" : [ "pet" ], - "summary" : "Updates a pet in the store with form data", - "description" : "", - "operationId" : "updatePetWithForm", - "consumes" : [ "application/x-www-form-urlencoded" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "petId", - "in" : "path", - "description" : "ID of pet that needs to be updated", - "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "name", - "in" : "formData", - "description" : "Updated name of the pet", - "required" : false, - "type" : "string" - }, { - "name" : "status", - "in" : "formData", - "description" : "Updated status of the pet", - "required" : false, - "type" : "string" - } ], - "responses" : { - "405" : { - "description" : "Invalid input" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - }, - "delete" : { - "tags" : [ "pet" ], - "summary" : "Deletes a pet", - "description" : "", - "operationId" : "deletePet", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "api_key", - "in" : "header", - "required" : false, - "type" : "string" - }, { - "name" : "petId", - "in" : "path", - "description" : "Pet id to delete", - "required" : true, - "type" : "integer", - "format" : "int64" - } ], - "responses" : { - "400" : { - "description" : "Invalid pet value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - } - }, - "/pet/{petId}/uploadImage" : { - "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image", - "description" : "", - "operationId" : "uploadFile", - "consumes" : [ "multipart/form-data" ], - "produces" : [ "application/json" ], - "parameters" : [ { - "name" : "petId", - "in" : "path", - "description" : "ID of pet to update", - "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "additionalMetadata", - "in" : "formData", - "description" : "Additional data to pass to server", - "required" : false, - "type" : "string" - }, { - "name" : "file", - "in" : "formData", - "description" : "file to upload", - "required" : false, - "type" : "file" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/ApiResponse" - } - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ] - } - }, - "/store/inventory" : { - "get" : { - "tags" : [ "store" ], - "summary" : "Returns pet inventories by status", - "description" : "Returns a map of status codes to quantities", - "operationId" : "getInventory", - "produces" : [ "application/json" ], - "parameters" : [ ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "object", - "additionalProperties" : { - "type" : "integer", - "format" : "int32" - } - } - } - }, - "security" : [ { - "api_key" : [ ] - } ] - } - }, - "/store/order" : { - "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", - "description" : "", - "operationId" : "placeOrder", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "order placed for purchasing the pet", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Order" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" - } - }, - "400" : { - "description" : "Invalid Order" - } - } - } - }, - "/store/order/{orderId}" : { - "get" : { - "tags" : [ "store" ], - "summary" : "Find purchase order by ID", - "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - "operationId" : "getOrderById", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "orderId", - "in" : "path", - "description" : "ID of pet that needs to be fetched", - "required" : true, - "type" : "integer", - "maximum" : 5, - "minimum" : 1, - "format" : "int64" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" - } - }, - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Order not found" - } - } - }, - "delete" : { - "tags" : [ "store" ], - "summary" : "Delete purchase order by ID", - "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", - "operationId" : "deleteOrder", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "orderId", - "in" : "path", - "description" : "ID of the order that needs to be deleted", - "required" : true, - "type" : "string", - "minimum" : 1 - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Order not found" - } - } - } - }, - "/user" : { - "post" : { - "tags" : [ "user" ], - "summary" : "Create user", - "description" : "This can only be done by the logged in user.", - "operationId" : "createUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Created user object", - "required" : true, - "schema" : { - "$ref" : "#/definitions/User" - } - } ], - "responses" : { - "default" : { - "description" : "successful operation" - } - } - } - }, - "/user/createWithArray" : { - "post" : { - "tags" : [ "user" ], - "summary" : "Creates list of users with given input array", - "description" : "", - "operationId" : "createUsersWithArrayInput", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "List of user object", - "required" : true, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/User" - } - } - } ], - "responses" : { - "default" : { - "description" : "successful operation" - } - } - } - }, - "/user/createWithList" : { - "post" : { - "tags" : [ "user" ], - "summary" : "Creates list of users with given input array", - "description" : "", - "operationId" : "createUsersWithListInput", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "List of user object", - "required" : true, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/User" - } - } - } ], - "responses" : { - "default" : { - "description" : "successful operation" - } - } - } - }, - "/user/login" : { - "get" : { - "tags" : [ "user" ], - "summary" : "Logs user into the system", - "description" : "", - "operationId" : "loginUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "query", - "description" : "The user name for login", - "required" : true, - "type" : "string" - }, { - "name" : "password", - "in" : "query", - "description" : "The password for login in clear text", - "required" : true, - "type" : "string" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "string" - }, - "headers" : { - "X-Rate-Limit" : { - "type" : "integer", - "format" : "int32", - "description" : "calls per hour allowed by the user" - }, - "X-Expires-After" : { - "type" : "string", - "format" : "date-time", - "description" : "date in UTC when toekn expires" - } - } - }, - "400" : { - "description" : "Invalid username/password supplied" - } - } - } - }, - "/user/logout" : { - "get" : { - "tags" : [ "user" ], - "summary" : "Logs out current logged in user session", - "description" : "", - "operationId" : "logoutUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ ], - "responses" : { - "default" : { - "description" : "successful operation" - } - } - } - }, - "/user/{username}" : { - "get" : { - "tags" : [ "user" ], - "summary" : "Get user by user name", - "description" : "", - "operationId" : "getUserByName", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "The name that needs to be fetched. Use user1 for testing. ", - "required" : true, - "type" : "string" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/User" - } - }, - "400" : { - "description" : "Invalid username supplied" - }, - "404" : { - "description" : "User not found" - } - } - }, - "put" : { - "tags" : [ "user" ], - "summary" : "Updated user", - "description" : "This can only be done by the logged in user.", - "operationId" : "updateUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "name that need to be deleted", - "required" : true, - "type" : "string" - }, { - "in" : "body", - "name" : "body", - "description" : "Updated user object", - "required" : true, - "schema" : { - "$ref" : "#/definitions/User" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid user supplied" - }, - "404" : { - "description" : "User not found" - } - } - }, - "delete" : { - "tags" : [ "user" ], - "summary" : "Delete user", - "description" : "This can only be done by the logged in user.", - "operationId" : "deleteUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "The name that needs to be deleted", - "required" : true, - "type" : "string" - } ], - "responses" : { - "400" : { - "description" : "Invalid username supplied" - }, - "404" : { - "description" : "User not found" - } - } - } - } - }, - "securityDefinitions" : { - "petstore_auth" : { - "type" : "oauth2", - "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", - "flow" : "implicit", - "scopes" : { - "write:pets" : "modify pets in your account", - "read:pets" : "read your pets" - } - }, - "api_key" : { - "type" : "apiKey", - "name" : "api_key", - "in" : "header" - } - }, - "definitions" : { - "Order" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "petId" : { - "type" : "integer", - "format" : "int64" - }, - "quantity" : { - "type" : "integer", - "format" : "int32" - }, - "shipDate" : { - "type" : "string", - "format" : "date-time" - }, - "status" : { - "type" : "string", - "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] - }, - "complete" : { - "type" : "boolean", - "default" : false - } - }, - "title" : "Pet Order", - "description" : "An order for a pets from the pet store", - "xml" : { - "name" : "Order" - } - }, - "Category" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - } - }, - "title" : "Pet catehgry", - "description" : "A category for a pet", - "xml" : { - "name" : "Category" - } - }, - "User" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "username" : { - "type" : "string" - }, - "firstName" : { - "type" : "string" - }, - "lastName" : { - "type" : "string" - }, - "email" : { - "type" : "string" - }, - "password" : { - "type" : "string" - }, - "phone" : { - "type" : "string" - }, - "userStatus" : { - "type" : "integer", - "format" : "int32", - "description" : "User Status" - } - }, - "title" : "a User", - "description" : "A User who is purchasing from the pet store", - "xml" : { - "name" : "User" - } - }, - "Tag" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - } - }, - "title" : "Pet Tag", - "description" : "A tag for a pet", - "xml" : { - "name" : "Tag" - } - }, - "Pet" : { - "type" : "object", - "required" : [ "name", "photoUrls" ], - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "category" : { - "$ref" : "#/definitions/Category" - }, - "name" : { - "type" : "string", - "example" : "doggie" - }, - "photoUrls" : { - "type" : "array", - "xml" : { - "name" : "photoUrl", - "wrapped" : true - }, - "items" : { - "type" : "string" - } - }, - "tags" : { - "type" : "array", - "xml" : { - "name" : "tag", - "wrapped" : true - }, - "items" : { - "$ref" : "#/definitions/Tag" - } - }, - "status" : { - "type" : "string", - "description" : "pet status in the store", - "enum" : [ "available", "pending", "sold" ] - } - }, - "title" : "a Pet", - "description" : "A pet for sale in the pet store", - "xml" : { - "name" : "Pet" - } - }, - "ApiResponse" : { - "type" : "object", - "properties" : { - "code" : { - "type" : "integer", - "format" : "int32" - }, - "type" : { - "type" : "string" - }, - "message" : { - "type" : "string" - } - }, - "title" : "An uploaded response", - "description" : "Describes the result of uploading an image resource" - } - }, - "externalDocs" : { - "description" : "Find out more about Swagger", - "url" : "http://swagger.io" - } +{ + "swagger" : "2.0", + "info" : { + "description" : "This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters", + "version" : "1.0.0", + "title" : "Swagger Petstore", + "termsOfService" : "http://helloreverb.com/terms/", + "contact" : { + "email" : "apiteam@wordnik.com" + }, + "license" : { + "name" : "Apache 2.0", + "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "host" : "petstore.swagger.io", + "basePath" : "/v2", + "schemes" : [ "http" ], + "paths" : { + "/pet" : { + "post" : { + "tags" : [ "pet" ], + "summary" : "Add a new pet to the store", + "description" : "", + "operationId" : "addPet", + "consumes" : [ "application/json", "application/xml" ], + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Pet object that needs to be added to the store", + "required" : false, + "schema" : { + "$ref" : "#/definitions/Pet" + } + } ], + "responses" : { + "405" : { + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + }, + "put" : { + "tags" : [ "pet" ], + "summary" : "Update an existing pet", + "description" : "", + "operationId" : "updatePet", + "consumes" : [ "application/json", "application/xml" ], + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Pet object that needs to be added to the store", + "required" : false, + "schema" : { + "$ref" : "#/definitions/Pet" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Pet not found" + }, + "405" : { + "description" : "Validation exception" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/pet/findByStatus" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Finds Pets by status", + "description" : "Multiple status values can be provided with comma separated strings", + "operationId" : "findPetsByStatus", + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "name" : "status", + "in" : "query", + "description" : "Status values that need to be considered for filter", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "available", "pending", "sold" ] + }, + "collectionFormat" : "multi", + "default" : "available" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Pet" + } + }, + "examples" : { + "application/json" : { + "name" : "Puma", + "type" : "Dog", + "color" : "Black", + "gender" : "Female", + "breed" : "Mixed" + } + } + }, + "400" : { + "description" : "Invalid status value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/pet/findByTags" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Finds Pets by tags", + "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "operationId" : "findPetsByTags", + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "name" : "tags", + "in" : "query", + "description" : "Tags to filter by", + "required" : false, + "type" : "array", + "items" : { + "type" : "string" + }, + "collectionFormat" : "multi" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Pet" + } + } + }, + "400" : { + "description" : "Invalid tag value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/pet/{petId}" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Find pet by ID", + "description" : "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions", + "operationId" : "getPetById", + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet that needs to be fetched", + "required" : true, + "type" : "integer", + "format" : "int64" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Pet" + } + }, + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Pet not found" + } + }, + "security" : [ { + "api_key" : [ ] + }, { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + }, + "post" : { + "tags" : [ "pet" ], + "summary" : "Updates a pet in the store with form data", + "description" : "", + "operationId" : "updatePetWithForm", + "consumes" : [ "application/x-www-form-urlencoded" ], + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet that needs to be updated", + "required" : true, + "type" : "string" + }, { + "name" : "name", + "in" : "formData", + "description" : "Updated name of the pet", + "required" : false, + "type" : "string" + }, { + "name" : "status", + "in" : "formData", + "description" : "Updated status of the pet", + "required" : false, + "type" : "string" + } ], + "responses" : { + "405" : { + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + }, + "delete" : { + "tags" : [ "pet" ], + "summary" : "Deletes a pet", + "description" : "", + "operationId" : "deletePet", + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "name" : "api_key", + "in" : "header", + "description" : "", + "required" : false, + "type" : "string" + }, { + "name" : "petId", + "in" : "path", + "description" : "Pet id to delete", + "required" : true, + "type" : "integer", + "format" : "int64" + } ], + "responses" : { + "400" : { + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/pet/{petId}/uploadImage" : { + "post" : { + "tags" : [ "pet" ], + "summary" : "uploads an image", + "description" : "", + "operationId" : "uploadFile", + "consumes" : [ "multipart/form-data" ], + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet to update", + "required" : true, + "type" : "integer", + "format" : "int64" + }, { + "name" : "additionalMetadata", + "in" : "formData", + "description" : "Additional data to pass to server", + "required" : false, + "type" : "string" + }, { + "name" : "file", + "in" : "formData", + "description" : "file to upload", + "required" : false, + "type" : "file" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/store/inventory" : { + "get" : { + "tags" : [ "store" ], + "summary" : "Returns pet inventories by status", + "description" : "Returns a map of status codes to quantities", + "operationId" : "getInventory", + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "integer", + "format" : "int32" + } + } + } + }, + "security" : [ { + "api_key" : [ ] + } ] + } + }, + "/store/order" : { + "post" : { + "tags" : [ "store" ], + "summary" : "Place an order for a pet", + "description" : "", + "operationId" : "placeOrder", + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "order placed for purchasing the pet", + "required" : false, + "schema" : { + "$ref" : "#/definitions/Order" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Order" + } + }, + "400" : { + "description" : "Invalid Order" + } + } + } + }, + "/store/order/{orderId}" : { + "get" : { + "tags" : [ "store" ], + "summary" : "Find purchase order by ID", + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "name" : "orderId", + "in" : "path", + "description" : "ID of pet that needs to be fetched", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Order" + } + }, + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Order not found" + } + } + }, + "delete" : { + "tags" : [ "store" ], + "summary" : "Delete purchase order by ID", + "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + "operationId" : "deleteOrder", + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "name" : "orderId", + "in" : "path", + "description" : "ID of the order that needs to be deleted", + "required" : true, + "type" : "string" + } ], + "responses" : { + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Order not found" + } + } + } + }, + "/user" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Create user", + "description" : "This can only be done by the logged in user.", + "operationId" : "createUser", + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Created user object", + "required" : false, + "schema" : { + "$ref" : "#/definitions/User" + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/user/createWithArray" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Creates list of users with given input array", + "description" : "", + "operationId" : "createUsersWithArrayInput", + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "List of user object", + "required" : false, + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/User" + } + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/user/createWithList" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Creates list of users with given input array", + "description" : "", + "operationId" : "createUsersWithListInput", + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "List of user object", + "required" : false, + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/User" + } + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/user/login" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Logs user into the system", + "description" : "", + "operationId" : "loginUser", + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "name" : "username", + "in" : "query", + "description" : "The user name for login", + "required" : false, + "type" : "string" + }, { + "name" : "password", + "in" : "query", + "description" : "The password for login in clear text", + "required" : false, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "string" + } + }, + "400" : { + "description" : "Invalid username/password supplied" + } + } + } + }, + "/user/logout" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Logs out current logged in user session", + "description" : "", + "operationId" : "logoutUser", + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/user/{username}" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Get user by user name", + "description" : "", + "operationId" : "getUserByName", + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The name that needs to be fetched. Use user1 for testing. ", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/User" + } + }, + "400" : { + "description" : "Invalid username supplied" + }, + "404" : { + "description" : "User not found" + } + } + }, + "put" : { + "tags" : [ "user" ], + "summary" : "Updated user", + "description" : "This can only be done by the logged in user.", + "operationId" : "updateUser", + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "name that need to be deleted", + "required" : true, + "type" : "string" + }, { + "in" : "body", + "name" : "body", + "description" : "Updated user object", + "required" : false, + "schema" : { + "$ref" : "#/definitions/User" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid user supplied" + }, + "404" : { + "description" : "User not found" + } + } + }, + "delete" : { + "tags" : [ "user" ], + "summary" : "Delete user", + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "produces" : [ "application/json", "application/xml" ], + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The name that needs to be deleted", + "required" : true, + "type" : "string" + } ], + "responses" : { + "400" : { + "description" : "Invalid username supplied" + }, + "404" : { + "description" : "User not found" + } + } + } + } + }, + "securityDefinitions" : { + "petstore_auth" : { + "type" : "oauth2", + "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", + "flow" : "implicit", + "scopes" : { + "write:pets" : "modify pets in your account", + "read:pets" : "read your pets" + } + }, + "api_key" : { + "type" : "apiKey", + "name" : "api_key", + "in" : "header" + } + }, + "definitions" : { + "User" : { + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "username" : { + "type" : "string" + }, + "firstName" : { + "type" : "string" + }, + "lastName" : { + "type" : "string" + }, + "email" : { + "type" : "string" + }, + "password" : { + "type" : "string" + }, + "phone" : { + "type" : "string" + }, + "userStatus" : { + "type" : "integer", + "format" : "int32", + "description" : "User Status" + } + }, + "xml" : { + "name" : "User" + } + }, + "Category" : { + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "xml" : { + "name" : "Category" + } + }, + "Pet" : { + "required" : [ "name", "photoUrls" ], + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "category" : { + "$ref" : "#/definitions/Category" + }, + "name" : { + "type" : "string", + "example" : "doggie" + }, + "photoUrls" : { + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + }, + "items" : { + "type" : "string" + } + }, + "tags" : { + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + }, + "items" : { + "$ref" : "#/definitions/Tag" + } + }, + "status" : { + "type" : "string", + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ] + } + }, + "xml" : { + "name" : "Pet" + } + }, + "Tag" : { + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "xml" : { + "name" : "Tag" + } + }, + "Order" : { + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "petId" : { + "type" : "integer", + "format" : "int64" + }, + "quantity" : { + "type" : "integer", + "format" : "int32" + }, + "shipDate" : { + "type" : "string", + "format" : "date-time" + }, + "status" : { + "type" : "string", + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ] + }, + "complete" : { + "type" : "boolean" + } + }, + "xml" : { + "name" : "Order" + } + } + } } \ No newline at end of file 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 new file mode 100644 index 00000000000..d3e0150011f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java @@ -0,0 +1,60 @@ +package io.swagger.api; + +import java.math.BigDecimal; +import io.swagger.model.Client; +import org.joda.time.LocalDate; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + +import io.swagger.annotations.*; + +import java.util.List; + +@Path("/fake") + +@Api(description = "the fake API") + + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJAXRSSpecServerCodegen", date = "2017-01-18T19:11:32.384+01:00") + +public class FakeApi { + + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + public Response testClientModel(Client body) { + return Response.ok().entity("magic!").build(); + } + + @POST + + @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) + @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = void.class, authorizations = { + @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) }) + public Response testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "_double") Double _double,@FormParam(value = "patternWithoutDelimiter") String patternWithoutDelimiter,@FormParam(value = "_byte") byte[] _byte,@FormParam(value = "integer", required = false) Integer integer,@FormParam(value = "int32", required = false) Integer int32,@FormParam(value = "int64", required = false) Long int64,@FormParam(value = "_float", required = false) Float _float,@FormParam(value = "string", required = false) String string,@FormParam(value = "binary", required = false) byte[] binary,@FormParam(value = "date", required = false) LocalDate date,@FormParam(value = "dateTime", required = false) javax.xml.datatype.XMLGregorianCalendar dateTime,@FormParam(value = "password", required = false) String password,@FormParam(value = "paramCallback", required = false) String paramCallback) { + return Response.ok().entity("magic!").build(); + } + + @GET + + @Consumes({ "*/*" }) + @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) }) + public Response testEnumParameters(@FormParam(value = "enumFormStringArray", required = false) List enumFormStringArray,@FormParam(value = "enumFormString", required = false) 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") String enumQueryString,@QueryParam("enum_query_integer") Integer enumQueryInteger,@FormParam(value = "enumQueryDouble", required = false) Double enumQueryDouble) { + return Response.ok().entity("magic!").build(); + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java new file mode 100644 index 00000000000..0e8e20a3eeb --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -0,0 +1,90 @@ +package io.swagger.model; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class AdditionalPropertiesClass { + + private Map mapProperty = new HashMap(); + private Map> mapOfMapProperty = new HashMap>(); + + /** + **/ + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public Map getMapProperty() { + return mapProperty; + } + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + /** + **/ + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; + return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + } + + @Override + public int hashCode() { + return Objects.hash(mapProperty, mapOfMapProperty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java new file mode 100644 index 00000000000..f14882cbf54 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java @@ -0,0 +1,89 @@ +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class Animal { + + private String className = null; + private String color = "red"; + + /** + **/ + public Animal className(String className) { + this.className = className; + return this; + } + + + @ApiModelProperty(example = "null", required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + /** + **/ + public Animal color(String color) { + this.color = color; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(className, animal.className) && + Objects.equals(color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java new file mode 100644 index 00000000000..eefaeeb83fc --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java @@ -0,0 +1,53 @@ +package io.swagger.model; + +import io.swagger.model.Animal; +import java.util.ArrayList; +import java.util.List; + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class AnimalFarm extends ArrayList { + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AnimalFarm animalFarm = (AnimalFarm) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnimalFarm {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..5990b864e2e --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,71 @@ +package io.swagger.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class ArrayOfArrayOfNumberOnly { + + private List> arrayArrayNumber = new ArrayList>(); + + /** + **/ + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..48914bf4043 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -0,0 +1,71 @@ +package io.swagger.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class ArrayOfNumberOnly { + + private List arrayNumber = new ArrayList(); + + /** + **/ + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public List getArrayNumber() { + return arrayNumber; + } + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java new file mode 100644 index 00000000000..0095dc23f9d --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java @@ -0,0 +1,109 @@ +package io.swagger.model; + +import io.swagger.model.ReadOnlyFirst; +import java.util.ArrayList; +import java.util.List; + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class ArrayTest { + + private List arrayOfString = new ArrayList(); + private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfModel = new ArrayList>(); + + /** + **/ + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public List getArrayOfString() { + return arrayOfString; + } + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + /** + **/ + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + /** + **/ + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(arrayOfString, arrayTest.arrayOfString) && + Objects.equals(arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} 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 new file mode 100644 index 00000000000..4609ebeed5b --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java @@ -0,0 +1,69 @@ +package io.swagger.model; + +import io.swagger.model.Animal; + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class Cat extends Animal { + + private Boolean declawed = null; + + /** + **/ + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public Boolean getDeclawed() { + return declawed; + } + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(declawed, cat.declawed); + } + + @Override + public int hashCode() { + return Objects.hash(declawed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java new file mode 100644 index 00000000000..ab4ab557fd5 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java @@ -0,0 +1,72 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; + + +/** + * Model for testing model with \"_class\" property + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "Model for testing model with \"_class\" property") + +public class ClassModel { + + private String propertyClass = null; + + /** + **/ + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public String getPropertyClass() { + return propertyClass; + } + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java new file mode 100644 index 00000000000..281112f5877 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java @@ -0,0 +1,68 @@ +package io.swagger.model; + + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class Client { + + private String client = null; + + /** + **/ + public Client client(String client) { + this.client = client; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public String getClient() { + return client; + } + public void setClient(String client) { + this.client = client; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java new file mode 100644 index 00000000000..991bad1dce6 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java @@ -0,0 +1,69 @@ +package io.swagger.model; + +import io.swagger.model.Animal; + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class Dog extends Animal { + + private String breed = null; + + /** + **/ + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public String getBreed() { + return breed; + } + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(breed, dog.breed); + } + + @Override + public int hashCode() { + return Objects.hash(breed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java new file mode 100644 index 00000000000..875109f4226 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java @@ -0,0 +1,140 @@ +package io.swagger.model; + +import java.util.ArrayList; +import java.util.List; + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class EnumArrays { + + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="EnumArrays") +@XmlEnum +public enum EnumArrays { + {values=[>=, $], enumVars=[{name=GREATER_THAN_OR_EQUAL_TO, value=">="}, {name=DOLLAR, value="$"}]}, + + public String value() { + return name(); + } + + public static EnumArrays fromValue(String v) { + return valueOf(v); + } +} + private JustSymbolEnum justSymbol = null; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="EnumArrays") +@XmlEnum +public enum EnumArrays { + {values=[fish, crab], enumVars=[{name=FISH, value="fish"}, {name=CRAB, value="crab"}]}, + + public String value() { + return name(); + } + + public static EnumArrays fromValue(String v) { + return valueOf(v); + } +} + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="EnumArrays") +@XmlEnum +public enum EnumArrays { + {values=[fish, crab], enumVars=[{name=FISH, value="fish"}, {name=CRAB, value="crab"}]}, + + public String value() { + return name(); + } + + public static EnumArrays fromValue(String v) { + return valueOf(v); + } +} + private List arrayEnum = new ArrayList(); + + /** + **/ + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + /** + **/ + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public List getArrayEnum() { + return arrayEnum; + } + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(justSymbol, enumArrays.justSymbol) && + Objects.equals(arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java new file mode 100644 index 00000000000..8af311452fb --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java @@ -0,0 +1,21 @@ +package io.swagger.model; + + + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="EnumClass") +@XmlEnum +public enum EnumClass { + {values=[_abc, -efg, (xyz)], enumVars=[{name=_ABC, value="_abc"}, {name=_EFG, value="-efg"}, {name=_XYZ_, value="(xyz)"}]}, + + public String value() { + return name(); + } + + public static EnumClass fromValue(String v) { + return valueOf(v); + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java new file mode 100644 index 00000000000..22f21b1538d --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java @@ -0,0 +1,177 @@ +package io.swagger.model; + +import io.swagger.model.OuterEnum; + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class EnumTest { + + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="EnumTest") +@XmlEnum +public enum EnumTest { + {values=[UPPER, lower], enumVars=[{name=UPPER, value="UPPER"}, {name=LOWER, value="lower"}]}, + + public String value() { + return name(); + } + + public static EnumTest fromValue(String v) { + return valueOf(v); + } +} + private EnumStringEnum enumString = null; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="EnumTest") +@XmlEnum +public enum EnumTest { + {values=[1, -1], enumVars=[{name=NUMBER_1, value=1}, {name=NUMBER_MINUS_1, value=-1}]}, + + public String value() { + return name(); + } + + public static EnumTest fromValue(String v) { + return valueOf(v); + } +} + private EnumIntegerEnum enumInteger = null; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="EnumTest") +@XmlEnum +public enum EnumTest { + {values=[1.1, -1.2], enumVars=[{name=NUMBER_1_DOT_1, value=1.1}, {name=NUMBER_MINUS_1_DOT_2, value=-1.2}]}, + + public String value() { + return name(); + } + + public static EnumTest fromValue(String v) { + return valueOf(v); + } +} + private EnumNumberEnum enumNumber = null; + private OuterEnum outerEnum = null; + + /** + **/ + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public EnumStringEnum getEnumString() { + return enumString; + } + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + /** + **/ + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + /** + **/ + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + /** + **/ + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public OuterEnum getOuterEnum() { + return outerEnum; + } + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(enumString, enumTest.enumString) && + Objects.equals(enumInteger, enumTest.enumInteger) && + Objects.equals(enumNumber, enumTest.enumNumber) && + Objects.equals(outerEnum, enumTest.outerEnum); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java new file mode 100644 index 00000000000..0d02a5af3e0 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java @@ -0,0 +1,308 @@ +package io.swagger.model; + +import java.math.BigDecimal; +import org.joda.time.LocalDate; + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class FormatTest { + + private Integer integer = null; + private Integer int32 = null; + private Long int64 = null; + private BigDecimal number = null; + private Float _float = null; + private Double _double = null; + private String string = null; + private byte[] _byte = null; + private byte[] binary = null; + private LocalDate date = null; + private javax.xml.datatype.XMLGregorianCalendar dateTime = null; + private String uuid = null; + private String password = null; + + /** + * minimum: 10 + * maximum: 100 + **/ + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public Integer getInteger() { + return integer; + } + public void setInteger(Integer integer) { + this.integer = integer; + } + + /** + * minimum: 20 + * maximum: 200 + **/ + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public Integer getInt32() { + return int32; + } + public void setInt32(Integer int32) { + this.int32 = int32; + } + + /** + **/ + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public Long getInt64() { + return int64; + } + public void setInt64(Long int64) { + this.int64 = int64; + } + + /** + * minimum: 32.1 + * maximum: 543.2 + **/ + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + + @ApiModelProperty(example = "null", required = true, value = "") + public BigDecimal getNumber() { + return number; + } + public void setNumber(BigDecimal number) { + this.number = number; + } + + /** + * minimum: 54.3 + * maximum: 987.6 + **/ + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public Float getFloat() { + return _float; + } + public void setFloat(Float _float) { + this._float = _float; + } + + /** + * minimum: 67.8 + * maximum: 123.4 + **/ + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public Double getDouble() { + return _double; + } + public void setDouble(Double _double) { + this._double = _double; + } + + /** + **/ + public FormatTest string(String string) { + this.string = string; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public String getString() { + return string; + } + public void setString(String string) { + this.string = string; + } + + /** + **/ + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + + @ApiModelProperty(example = "null", required = true, value = "") + public byte[] getByte() { + return _byte; + } + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + /** + **/ + public FormatTest binary(byte[] binary) { + this.binary = binary; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public byte[] getBinary() { + return binary; + } + public void setBinary(byte[] binary) { + this.binary = binary; + } + + /** + **/ + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + + @ApiModelProperty(example = "null", required = true, value = "") + public LocalDate getDate() { + return date; + } + public void setDate(LocalDate date) { + this.date = date; + } + + /** + **/ + public FormatTest dateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) { + this.dateTime = dateTime; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public javax.xml.datatype.XMLGregorianCalendar getDateTime() { + return dateTime; + } + public void setDateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) { + this.dateTime = dateTime; + } + + /** + **/ + public FormatTest uuid(String uuid) { + this.uuid = uuid; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public String getUuid() { + return uuid; + } + public void setUuid(String uuid) { + this.uuid = uuid; + } + + /** + **/ + public FormatTest password(String password) { + this.password = password; + return this; + } + + + @ApiModelProperty(example = "null", required = true, value = "") + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(integer, formatTest.integer) && + Objects.equals(int32, formatTest.int32) && + Objects.equals(int64, formatTest.int64) && + Objects.equals(number, formatTest.number) && + Objects.equals(_float, formatTest._float) && + Objects.equals(_double, formatTest._double) && + Objects.equals(string, formatTest.string) && + Objects.equals(_byte, formatTest._byte) && + Objects.equals(binary, formatTest.binary) && + Objects.equals(date, formatTest.date) && + Objects.equals(dateTime, formatTest.dateTime) && + Objects.equals(uuid, formatTest.uuid) && + Objects.equals(password, formatTest.password); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..03adf0ab2cc --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -0,0 +1,87 @@ +package io.swagger.model; + + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class HasOnlyReadOnly { + + private String bar = null; + private String foo = null; + + /** + **/ + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public String getBar() { + return bar; + } + public void setBar(String bar) { + this.bar = bar; + } + + /** + **/ + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public String getFoo() { + return foo; + } + public void setFoo(String foo) { + this.foo = foo; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(bar, hasOnlyReadOnly.bar) && + Objects.equals(foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java new file mode 100644 index 00000000000..fde68fee594 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java @@ -0,0 +1,124 @@ +package io.swagger.model; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class MapTest { + + private Map> mapMapOfString = new HashMap>(); + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="MapTest") +@XmlEnum +public enum MapTest { + {values=[UPPER, lower], enumVars=[{name=UPPER, value="UPPER"}, {name=LOWER, value="lower"}]}, + + public String value() { + return name(); + } + + public static MapTest fromValue(String v) { + return valueOf(v); + } +} + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="MapTest") +@XmlEnum +public enum MapTest { + {values=[UPPER, lower], enumVars=[{name=UPPER, value="UPPER"}, {name=LOWER, value="lower"}]}, + + public String value() { + return name(); + } + + public static MapTest fromValue(String v) { + return valueOf(v); + } +} + private Map mapOfEnumString = new HashMap(); + + /** + **/ + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public Map> getMapMapOfString() { + return mapMapOfString; + } + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + /** + **/ + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public Map getMapOfEnumString() { + return mapOfEnumString; + } + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(mapOfEnumString, mapTest.mapOfEnumString); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 00000000000..011d1fe10c7 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,110 @@ +package io.swagger.model; + +import io.swagger.model.Animal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class MixedPropertiesAndAdditionalPropertiesClass { + + private String uuid = null; + private javax.xml.datatype.XMLGregorianCalendar dateTime = null; + private Map map = new HashMap(); + + /** + **/ + public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + this.uuid = uuid; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public String getUuid() { + return uuid; + } + public void setUuid(String uuid) { + this.uuid = uuid; + } + + /** + **/ + public MixedPropertiesAndAdditionalPropertiesClass dateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) { + this.dateTime = dateTime; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public javax.xml.datatype.XMLGregorianCalendar getDateTime() { + return dateTime; + } + public void setDateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) { + this.dateTime = dateTime; + } + + /** + **/ + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public Map getMap() { + return map; + } + public void setMap(Map map) { + this.map = map; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java new file mode 100644 index 00000000000..9d8ebc07c02 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java @@ -0,0 +1,91 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; + + +/** + * Model for testing model name starting with number + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "Model for testing model name starting with number") + +public class Model200Response { + + private Integer name = null; + private String propertyClass = null; + + /** + **/ + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public Integer getName() { + return name; + } + public void setName(Integer name) { + this.name = name; + } + + /** + **/ + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public String getPropertyClass() { + return propertyClass; + } + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200Response = (Model200Response) o; + return Objects.equals(name, _200Response.name) && + Objects.equals(propertyClass, _200Response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java new file mode 100644 index 00000000000..286c9c06502 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java @@ -0,0 +1,72 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; + + +/** + * Model for testing reserved words + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "Model for testing reserved words") + +public class ModelReturn { + + private Integer _return = null; + + /** + **/ + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public Integer getReturn() { + return _return; + } + public void setReturn(Integer _return) { + this._return = _return; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(_return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java new file mode 100644 index 00000000000..2960c177bde --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java @@ -0,0 +1,129 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; + + +/** + * Model for testing model name same as property name + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "Model for testing model name same as property name") + +public class Name { + + private Integer name = null; + private Integer snakeCase = null; + private String property = null; + private Integer _123Number = null; + + /** + **/ + public Name name(Integer name) { + this.name = name; + return this; + } + + + @ApiModelProperty(example = "null", required = true, value = "") + public Integer getName() { + return name; + } + public void setName(Integer name) { + this.name = name; + } + + /** + **/ + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public Integer getSnakeCase() { + return snakeCase; + } + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + /** + **/ + public Name property(String property) { + this.property = property; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public String getProperty() { + return property; + } + public void setProperty(String property) { + this.property = property; + } + + /** + **/ + public Name _123Number(Integer _123Number) { + this._123Number = _123Number; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public Integer get123Number() { + return _123Number; + } + public void set123Number(Integer _123Number) { + this._123Number = _123Number; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(name, name.name) && + Objects.equals(snakeCase, name.snakeCase) && + Objects.equals(property, name.property) && + Objects.equals(_123Number, name._123Number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123Number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123Number: ").append(toIndentedString(_123Number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java new file mode 100644 index 00000000000..c1ea5771c5a --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java @@ -0,0 +1,69 @@ +package io.swagger.model; + +import java.math.BigDecimal; + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class NumberOnly { + + private BigDecimal justNumber = null; + + /** + **/ + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public BigDecimal getJustNumber() { + return justNumber; + } + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java new file mode 100644 index 00000000000..c1db34b0d9f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java @@ -0,0 +1,21 @@ +package io.swagger.model; + + + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="OuterEnum") +@XmlEnum +public enum OuterEnum { + {values=[placed, approved, delivered], enumVars=[{name=PLACED, value="placed"}, {name=APPROVED, value="approved"}, {name=DELIVERED, value="delivered"}]}, + + public String value() { + return name(); + } + + public static OuterEnum fromValue(String v) { + return valueOf(v); + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java new file mode 100644 index 00000000000..52b140917da --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -0,0 +1,87 @@ +package io.swagger.model; + + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class ReadOnlyFirst { + + private String bar = null; + private String baz = null; + + /** + **/ + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public String getBar() { + return bar; + } + public void setBar(String bar) { + this.bar = bar; + } + + /** + **/ + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public String getBaz() { + return baz; + } + public void setBaz(String baz) { + this.baz = baz; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(bar, readOnlyFirst.bar) && + Objects.equals(baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java new file mode 100644 index 00000000000..2adfad37dc9 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java @@ -0,0 +1,68 @@ +package io.swagger.model; + + + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class SpecialModelName { + + private Long specialPropertyName = null; + + /** + **/ + public SpecialModelName specialPropertyName(Long specialPropertyName) { + this.specialPropertyName = specialPropertyName; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + public Long getSpecialPropertyName() { + return specialPropertyName; + } + public void setSpecialPropertyName(Long specialPropertyName) { + this.specialPropertyName = specialPropertyName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(specialPropertyName, specialModelName.specialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash(specialPropertyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + + sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} From 4b301f78db525427d8fde679d5635bf947e21911 Mon Sep 17 00:00:00 2001 From: Johannes Fiala Date: Thu, 19 Jan 2017 21:14:20 +0100 Subject: [PATCH 14/23] fix handling of inner enum templates #4091 --- .../JavaJaxRS/cxf-cdi/enumClass.mustache | 39 +++++++++++++------ .../resources/JavaJaxRS/cxf-cdi/pojo.mustache | 3 ++ .../src/gen/java/io/swagger/api/PetApi.java | 1 - .../gen/java/io/swagger/model/Category.java | 3 ++ .../src/gen/java/io/swagger/model/Order.java | 39 ++++++++++++++----- .../src/gen/java/io/swagger/model/Pet.java | 39 ++++++++++++++----- .../src/gen/java/io/swagger/model/Tag.java | 3 ++ .../src/gen/java/io/swagger/model/User.java | 3 ++ 8 files changed, 98 insertions(+), 32 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/enumClass.mustache index 1ef4a61efbe..10bb9d0f4e0 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/enumClass.mustache @@ -1,16 +1,33 @@ -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; +@XmlType(name="{{datatypeWithEnum}}") +@XmlEnum({{datatype}}.class) +public enum {{datatypeWithEnum}} { + + {{#allowableValues}} + {{#enumVars}}@XmlEnumValue({{{value}}}) {{name}}({{datatype}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} + {{/allowableValues}} + + + private {{datatype}} value; + + {{datatypeWithEnum}} ({{datatype}} v) { + value = v; + } -@XmlType(name="{{classname}}") -@XmlEnum -public enum {{classname}} { - {{#allowableValues}}{{.}}{{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/allowableValues}} - public String value() { - return name(); + return value; + } + + @Override + public String toString() { + return String.valueOf(value); } - public static {{classname}} fromValue(String v) { - return valueOf(v); + public static {{datatypeWithEnum}} fromValue(String v) { + for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; } -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache index c3b9637c2fc..93f920d4d12 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache @@ -1,5 +1,8 @@ import io.swagger.annotations.*; import java.util.Objects; + +import javax.xml.bind.annotation.*; + {{#description}}@ApiModel(description = "{{{description}}}"){{/description}} public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { 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 451c0bf74e7..c0717b2b907 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 @@ -14,7 +14,6 @@ import io.swagger.annotations.*; import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import org.apache.cxf.jaxrs.ext.multipart.Multipart; import java.util.List; import javax.validation.constraints.*; diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java index c9c83bea176..a152efac6ed 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java @@ -8,6 +8,9 @@ import io.swagger.annotations.*; import java.util.Objects; +import javax.xml.bind.annotation.*; + + public class Category { diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java index 467f81f68da..9b81cf4e377 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java @@ -8,6 +8,9 @@ import io.swagger.annotations.*; import java.util.Objects; +import javax.xml.bind.annotation.*; + + public class Order { @@ -16,22 +19,38 @@ public class Order { private Integer quantity = null; private java.util.Date shipDate = null; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; +@XmlType(name="StatusEnum") +@XmlEnum(String.class) +public enum StatusEnum { + + @XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered")); + + + private String value; + + StatusEnum (String v) { + value = v; + } -@XmlType(name="Order") -@XmlEnum -public enum Order { - {values=[placed, approved, delivered], enumVars=[{name=PLACED, value="placed"}, {name=APPROVED, value="approved"}, {name=DELIVERED, value="delivered"}]}, - public String value() { - return name(); + return value; } - public static Order fromValue(String v) { - return valueOf(v); + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String v) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; } } + private StatusEnum status = null; private Boolean complete = null; diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java index 03b661f947d..0346e2aaeb5 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java @@ -12,6 +12,9 @@ import io.swagger.annotations.*; import java.util.Objects; +import javax.xml.bind.annotation.*; + + public class Pet { @@ -21,22 +24,38 @@ public class Pet { private List photoUrls = new ArrayList(); private List tags = new ArrayList(); -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; +@XmlType(name="StatusEnum") +@XmlEnum(String.class) +public enum StatusEnum { + + @XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold")); + + + private String value; + + StatusEnum (String v) { + value = v; + } -@XmlType(name="Pet") -@XmlEnum -public enum Pet { - {values=[available, pending, sold], enumVars=[{name=AVAILABLE, value="available"}, {name=PENDING, value="pending"}, {name=SOLD, value="sold"}]}, - public String value() { - return name(); + return value; } - public static Pet fromValue(String v) { - return valueOf(v); + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String v) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; } } + private StatusEnum status = null; /** diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java index f3d7c9108cb..f5595c760d5 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java @@ -8,6 +8,9 @@ import io.swagger.annotations.*; import java.util.Objects; +import javax.xml.bind.annotation.*; + + public class Tag { diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java index 3e3802e1d43..a7ebc60e571 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java @@ -8,6 +8,9 @@ import io.swagger.annotations.*; import java.util.Objects; +import javax.xml.bind.annotation.*; + + public class User { From df675819046169e359af59a779f55ad2b4d70552 Mon Sep 17 00:00:00 2001 From: Johannes Fiala Date: Thu, 19 Jan 2017 21:20:51 +0100 Subject: [PATCH 15/23] fix InputStream/Multipart imports and fileInputStream variable #4091 --- .../resources/JavaJaxRS/cxf-cdi/api.mustache | 4 +- .../JavaJaxRS/cxf-cdi/apiService.mustache | 1 + .../src/gen/java/io/swagger/api/PetApi.java | 4 +- .../java/io/swagger/api/PetApiService.java | 1 + .../src/gen/java/io/swagger/api/StoreApi.java | 2 + .../java/io/swagger/api/StoreApiService.java | 1 + .../src/gen/java/io/swagger/api/UserApi.java | 2 + .../java/io/swagger/api/UserApiService.java | 57 ++++++++++--------- 8 files changed, 42 insertions(+), 30 deletions(-) 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 e048e3982aa..263f9577251 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 @@ -12,8 +12,10 @@ import javax.enterprise.context.RequestScoped; import javax.inject.Inject; import io.swagger.annotations.*; +import java.io.InputStream; import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; import java.util.List; {{#useBeanValidation}} @@ -50,7 +52,7 @@ public class {{classname}} { @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}},{{/hasMore}}{{/responses}} }) public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { - return delegate.{{nickname}}({{#allParams}}{{#isFile}}inputStream, fileDetail{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}, {{/allParams}}securityContext); + return delegate.{{nickname}}({{#allParams}}{{#isFile}}fileInputStream, fileDetail{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}, {{/allParams}}securityContext); } {{/operation}} } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/apiService.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/apiService.mustache index 64eb6e38adb..4af44698b7c 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/apiService.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/apiService.mustache @@ -4,6 +4,7 @@ import {{package}}.*; import {{modelPackage}}.*; import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; {{#imports}}import {{import}}; {{/imports}} 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 c0717b2b907..0d8f998c5d3 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 @@ -12,8 +12,10 @@ import javax.inject.Inject; import io.swagger.annotations.*; +import java.io.InputStream; import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; import java.util.List; import javax.validation.constraints.*; @@ -164,6 +166,6 @@ public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = void.class) }) public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file", required = false) InputStream fileInputStream, @Multipart(value = "file" , required = false) Attachment fileDetail) { - return delegate.uploadFile(petId, additionalMetadata, inputStream, fileDetail, securityContext); + return delegate.uploadFile(petId, additionalMetadata, fileInputStream, fileDetail, securityContext); } } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java index 3e1aa1e456e..e7f8ee839d5 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java @@ -4,6 +4,7 @@ import io.swagger.model.*; import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; import java.io.File; import io.swagger.model.Pet; 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 fa05d9c443e..9622f17e894 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 @@ -12,8 +12,10 @@ import javax.inject.Inject; import io.swagger.annotations.*; +import java.io.InputStream; import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; import java.util.List; import javax.validation.constraints.*; diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java index 584fdd92ba6..ce9dd593a7a 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java @@ -4,6 +4,7 @@ import io.swagger.model.*; import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; import java.util.Map; import io.swagger.model.Order; 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 052d85fd5e2..354b124c4d4 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 @@ -12,8 +12,10 @@ import javax.inject.Inject; import io.swagger.annotations.*; +import java.io.InputStream; import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; import java.util.List; import javax.validation.constraints.*; diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java index 922b7ac3021..ed05f0abe27 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java @@ -1,28 +1,29 @@ -package io.swagger.api; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.List; -import io.swagger.model.User; - -import java.util.List; - -import java.io.InputStream; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - - -public interface UserApiService { - public Response createUser(User body, SecurityContext securityContext); - public Response createUsersWithArrayInput(List body, SecurityContext securityContext); - public Response createUsersWithListInput(List body, SecurityContext securityContext); - public Response deleteUser(String username, SecurityContext securityContext); - public Response getUserByName(String username, SecurityContext securityContext); - public Response loginUser(String username, String password, SecurityContext securityContext); - public Response logoutUser(SecurityContext securityContext); - public Response updateUser(String username, User body, SecurityContext securityContext); -} +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; + +import java.util.List; +import io.swagger.model.User; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public interface UserApiService { + public Response createUser(User body, SecurityContext securityContext); + public Response createUsersWithArrayInput(List body, SecurityContext securityContext); + public Response createUsersWithListInput(List body, SecurityContext securityContext); + public Response deleteUser(String username, SecurityContext securityContext); + public Response getUserByName(String username, SecurityContext securityContext); + public Response loginUser(String username, String password, SecurityContext securityContext); + public Response logoutUser(SecurityContext securityContext); + public Response updateUser(String username, User body, SecurityContext securityContext); +} From f8487aa8a60c224a023deb96eb9ea944a5e336a8 Mon Sep 17 00:00:00 2001 From: Johannes Fiala Date: Mon, 23 Jan 2017 20:41:46 +0100 Subject: [PATCH 16/23] fix paramName for files #4091 --- .../src/main/resources/JavaJaxRS/cxf-cdi/api.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 263f9577251..b891b7e8436 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 @@ -52,7 +52,7 @@ public class {{classname}} { @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}},{{/hasMore}}{{/responses}} }) public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { - return delegate.{{nickname}}({{#allParams}}{{#isFile}}fileInputStream, fileDetail{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}, {{/allParams}}securityContext); + return delegate.{{nickname}}({{#allParams}}{{#isFile}}{{paramName}}InputStream, fileDetail{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}, {{/allParams}}securityContext); } {{/operation}} } From c3669c4b4a259b8078346930a7788bd9743ec542 Mon Sep 17 00:00:00 2001 From: Johannes Fiala Date: Mon, 23 Jan 2017 20:45:09 +0100 Subject: [PATCH 17/23] consolidate beanValidationParams #4091 --- .../resources/JavaJaxRS/cxf-cdi/beanValidationParams.mustache | 1 + .../JavaJaxRS/cxf-cdi/beanValidationPathParams.mustache | 2 +- .../JavaJaxRS/cxf-cdi/beanValidationQueryParams.mustache | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationParams.mustache diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationParams.mustache new file mode 100644 index 00000000000..73c9a5af327 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationParams.mustache @@ -0,0 +1 @@ +{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationPathParams.mustache index e3060fa6c6a..23429296ccf 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationPathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationPathParams.mustache @@ -1 +1 @@ -{{! PathParam is always required, no @NotNull necessary }}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationParams}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationQueryParams.mustache index 52440b12218..d8879247953 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationQueryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationParams}} \ No newline at end of file From 9b4c327e44cc67eaaacd6fac90b8651621ab85b0 Mon Sep 17 00:00:00 2001 From: Johannes Fiala Date: Wed, 25 Jan 2017 21:47:29 +0100 Subject: [PATCH 18/23] add paramNameDetail #4615 --- .../src/main/resources/JavaJaxRS/cxf-cdi/api.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b891b7e8436..0586b6df351 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 @@ -52,7 +52,7 @@ public class {{classname}} { @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}},{{/hasMore}}{{/responses}} }) public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { - return delegate.{{nickname}}({{#allParams}}{{#isFile}}{{paramName}}InputStream, fileDetail{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}, {{/allParams}}securityContext); + return delegate.{{nickname}}({{#allParams}}{{#isFile}}{{paramName}}InputStream, {{paramName}}Detail{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}, {{/allParams}}securityContext); } {{/operation}} } From 66156fc7537cf4208232890c2235711b11dc8d4d Mon Sep 17 00:00:00 2001 From: Johannes Fiala Date: Wed, 25 Jan 2017 21:53:09 +0100 Subject: [PATCH 19/23] fix indentation and regenerate samples #4615 --- .../resources/JavaJaxRS/cxf-cdi/pom.mustache | 14 +- samples/server/petstore/jaxrs-cxf-cdi/pom.xml | 170 +++++++++--------- .../io/swagger/model/ModelApiResponse.java | 116 ------------ 3 files changed, 96 insertions(+), 204 deletions(-) delete mode 100644 samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache index 508136322f2..eba993f83fc 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache @@ -78,13 +78,13 @@ {{#useBeanValidation}} - - - javax.validation - validation-api - 1.1.0.Final - provided - + + + javax.validation + validation-api + 1.1.0.Final + provided + {{/useBeanValidation}} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/pom.xml b/samples/server/petstore/jaxrs-cxf-cdi/pom.xml index fcd2045b2ff..0b12e6bd4a4 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-cdi/pom.xml @@ -1,82 +1,90 @@ - - 4.0.0 - io.swagger - swagger-jaxrs-cxf-cdi-server - war - swagger-jaxrs-cxf-cdi-server - 1.0.0 - - - - src/main/java - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.9.1 - - - add-source - generate-sources - - add-source - - - - src/gen/java - - - - - - - - - maven-war-plugin - 3.0.0 - - false - - - - - - - - - - javax - javaee-api - 7.0 - provided - - - - - org.apache.cxf - cxf-rt-frontend-jaxrs - - - 3.0.2 - provided - - - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - [2.8.3,3) - - - - - io.swagger - swagger-annotations - [1.5.3,2) - - - - + + 4.0.0 + io.swagger + swagger-jaxrs-cxf-cdi-server + war + swagger-jaxrs-cxf-cdi-server + 1.0.0 + + + + src/main/java + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + + + maven-war-plugin + 3.0.0 + + false + + + + + + + + + + javax + javaee-api + 7.0 + provided + + + + + org.apache.cxf + cxf-rt-frontend-jaxrs + + + 3.0.2 + provided + + + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + [2.8.3,3) + + + + + io.swagger + swagger-annotations + [1.5.3,2) + + + + + javax.validation + validation-api + 1.1.0.Final + provided + + + + \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java deleted file mode 100644 index 2b65185e9cf..00000000000 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java +++ /dev/null @@ -1,116 +0,0 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import javax.validation.constraints.*; - -/** - * Describes the result of uploading an image resource - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "Describes the result of uploading an image resource") - -public class ModelApiResponse { - - private Integer code = null; - private String type = null; - private String message = null; - - /** - **/ - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("code") - public Integer getCode() { - return code; - } - public void setCode(Integer code) { - this.code = code; - } - - /** - **/ - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("type") - public String getType() { - return type; - } - public void setType(String type) { - this.type = type; - } - - /** - **/ - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("message") - public String getMessage() { - return message; - } - public void setMessage(String message) { - this.message = message; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(code, _apiResponse.code) && - Objects.equals(type, _apiResponse.type) && - Objects.equals(message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - From c87e93f7752edb6fb87b5b29cf84a8e0cef31272 Mon Sep 17 00:00:00 2001 From: Johannes Fiala Date: Wed, 25 Jan 2017 21:58:11 +0100 Subject: [PATCH 20/23] reset samples jaxrs-spec to master --- .../src/gen/java/io/swagger/api/FakeApi.java | 60 ---- .../model/AdditionalPropertiesClass.java | 90 ----- .../src/gen/java/io/swagger/model/Animal.java | 89 ----- .../gen/java/io/swagger/model/AnimalFarm.java | 53 --- .../model/ArrayOfArrayOfNumberOnly.java | 71 ---- .../io/swagger/model/ArrayOfNumberOnly.java | 71 ---- .../gen/java/io/swagger/model/ArrayTest.java | 109 ------- .../src/gen/java/io/swagger/model/Cat.java | 69 ---- .../gen/java/io/swagger/model/ClassModel.java | 72 ---- .../src/gen/java/io/swagger/model/Client.java | 68 ---- .../src/gen/java/io/swagger/model/Dog.java | 69 ---- .../gen/java/io/swagger/model/EnumArrays.java | 140 -------- .../gen/java/io/swagger/model/EnumClass.java | 21 -- .../gen/java/io/swagger/model/EnumTest.java | 177 ---------- .../gen/java/io/swagger/model/FormatTest.java | 308 ------------------ .../io/swagger/model/HasOnlyReadOnly.java | 87 ----- .../gen/java/io/swagger/model/MapTest.java | 124 ------- ...ropertiesAndAdditionalPropertiesClass.java | 110 ------- .../io/swagger/model/Model200Response.java | 91 ------ .../java/io/swagger/model/ModelReturn.java | 72 ---- .../src/gen/java/io/swagger/model/Name.java | 129 -------- .../gen/java/io/swagger/model/NumberOnly.java | 69 ---- .../gen/java/io/swagger/model/OuterEnum.java | 21 -- .../java/io/swagger/model/ReadOnlyFirst.java | 87 ----- .../io/swagger/model/SpecialModelName.java | 68 ---- 25 files changed, 2325 deletions(-) delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java 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 deleted file mode 100644 index d3e0150011f..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java +++ /dev/null @@ -1,60 +0,0 @@ -package io.swagger.api; - -import java.math.BigDecimal; -import io.swagger.model.Client; -import org.joda.time.LocalDate; - -import javax.ws.rs.*; -import javax.ws.rs.core.Response; - -import io.swagger.annotations.*; - -import java.util.List; - -@Path("/fake") - -@Api(description = "the fake API") - - -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJAXRSSpecServerCodegen", date = "2017-01-18T19:11:32.384+01:00") - -public class FakeApi { - - @PATCH - - @Consumes({ "application/json" }) - @Produces({ "application/json" }) - @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testClientModel(Client body) { - return Response.ok().entity("magic!").build(); - } - - @POST - - @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = void.class, authorizations = { - @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) }) - public Response testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "_double") Double _double,@FormParam(value = "patternWithoutDelimiter") String patternWithoutDelimiter,@FormParam(value = "_byte") byte[] _byte,@FormParam(value = "integer", required = false) Integer integer,@FormParam(value = "int32", required = false) Integer int32,@FormParam(value = "int64", required = false) Long int64,@FormParam(value = "_float", required = false) Float _float,@FormParam(value = "string", required = false) String string,@FormParam(value = "binary", required = false) byte[] binary,@FormParam(value = "date", required = false) LocalDate date,@FormParam(value = "dateTime", required = false) javax.xml.datatype.XMLGregorianCalendar dateTime,@FormParam(value = "password", required = false) String password,@FormParam(value = "paramCallback", required = false) String paramCallback) { - return Response.ok().entity("magic!").build(); - } - - @GET - - @Consumes({ "*/*" }) - @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) }) - public Response testEnumParameters(@FormParam(value = "enumFormStringArray", required = false) List enumFormStringArray,@FormParam(value = "enumFormString", required = false) 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") String enumQueryString,@QueryParam("enum_query_integer") Integer enumQueryInteger,@FormParam(value = "enumQueryDouble", required = false) Double enumQueryDouble) { - return Response.ok().entity("magic!").build(); - } -} - diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java deleted file mode 100644 index 0e8e20a3eeb..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ /dev/null @@ -1,90 +0,0 @@ -package io.swagger.model; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class AdditionalPropertiesClass { - - private Map mapProperty = new HashMap(); - private Map> mapOfMapProperty = new HashMap>(); - - /** - **/ - public AdditionalPropertiesClass mapProperty(Map mapProperty) { - this.mapProperty = mapProperty; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public Map getMapProperty() { - return mapProperty; - } - public void setMapProperty(Map mapProperty) { - this.mapProperty = mapProperty; - } - - /** - **/ - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public Map> getMapOfMapProperty() { - return mapOfMapProperty; - } - public void setMapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); - } - - @Override - public int hashCode() { - return Objects.hash(mapProperty, mapOfMapProperty); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\n"); - - sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); - sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java deleted file mode 100644 index f14882cbf54..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java +++ /dev/null @@ -1,89 +0,0 @@ -package io.swagger.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class Animal { - - private String className = null; - private String color = "red"; - - /** - **/ - public Animal className(String className) { - this.className = className; - return this; - } - - - @ApiModelProperty(example = "null", required = true, value = "") - public String getClassName() { - return className; - } - public void setClassName(String className) { - this.className = className; - } - - /** - **/ - public Animal color(String color) { - this.color = color; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public String getColor() { - return color; - } - public void setColor(String color) { - this.color = color; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(className, animal.className) && - Objects.equals(color, animal.color); - } - - @Override - public int hashCode() { - return Objects.hash(className, color); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java deleted file mode 100644 index eefaeeb83fc..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java +++ /dev/null @@ -1,53 +0,0 @@ -package io.swagger.model; - -import io.swagger.model.Animal; -import java.util.ArrayList; -import java.util.List; - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class AnimalFarm extends ArrayList { - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AnimalFarm animalFarm = (AnimalFarm) o; - return true; - } - - @Override - public int hashCode() { - return Objects.hash(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java deleted file mode 100644 index 5990b864e2e..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ /dev/null @@ -1,71 +0,0 @@ -package io.swagger.model; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class ArrayOfArrayOfNumberOnly { - - private List> arrayArrayNumber = new ArrayList>(); - - /** - **/ - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayArrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java deleted file mode 100644 index 48914bf4043..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ /dev/null @@ -1,71 +0,0 @@ -package io.swagger.model; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class ArrayOfNumberOnly { - - private List arrayNumber = new ArrayList(); - - /** - **/ - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public List getArrayNumber() { - return arrayNumber; - } - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(arrayNumber, arrayOfNumberOnly.arrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java deleted file mode 100644 index 0095dc23f9d..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java +++ /dev/null @@ -1,109 +0,0 @@ -package io.swagger.model; - -import io.swagger.model.ReadOnlyFirst; -import java.util.ArrayList; -import java.util.List; - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class ArrayTest { - - private List arrayOfString = new ArrayList(); - private List> arrayArrayOfInteger = new ArrayList>(); - private List> arrayArrayOfModel = new ArrayList>(); - - /** - **/ - public ArrayTest arrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public List getArrayOfString() { - return arrayOfString; - } - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - /** - **/ - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - /** - **/ - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(arrayOfString, arrayTest.arrayOfString) && - Objects.equals(arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(arrayArrayOfModel, arrayTest.arrayArrayOfModel); - } - - @Override - public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} 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 deleted file mode 100644 index 4609ebeed5b..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java +++ /dev/null @@ -1,69 +0,0 @@ -package io.swagger.model; - -import io.swagger.model.Animal; - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class Cat extends Animal { - - private Boolean declawed = null; - - /** - **/ - public Cat declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public Boolean getDeclawed() { - return declawed; - } - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cat cat = (Cat) o; - return Objects.equals(declawed, cat.declawed); - } - - @Override - public int hashCode() { - return Objects.hash(declawed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java deleted file mode 100644 index ab4ab557fd5..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java +++ /dev/null @@ -1,72 +0,0 @@ -package io.swagger.model; - -import io.swagger.annotations.ApiModel; - - -/** - * Model for testing model with \"_class\" property - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "Model for testing model with \"_class\" property") - -public class ClassModel { - - private String propertyClass = null; - - /** - **/ - public ClassModel propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public String getPropertyClass() { - return propertyClass; - } - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClassModel classModel = (ClassModel) o; - return Objects.equals(propertyClass, classModel.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java deleted file mode 100644 index 281112f5877..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java +++ /dev/null @@ -1,68 +0,0 @@ -package io.swagger.model; - - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class Client { - - private String client = null; - - /** - **/ - public Client client(String client) { - this.client = client; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public String getClient() { - return client; - } - public void setClient(String client) { - this.client = client; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Client client = (Client) o; - return Objects.equals(client, client.client); - } - - @Override - public int hashCode() { - return Objects.hash(client); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Client {\n"); - - sb.append(" client: ").append(toIndentedString(client)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java deleted file mode 100644 index 991bad1dce6..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java +++ /dev/null @@ -1,69 +0,0 @@ -package io.swagger.model; - -import io.swagger.model.Animal; - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class Dog extends Animal { - - private String breed = null; - - /** - **/ - public Dog breed(String breed) { - this.breed = breed; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public String getBreed() { - return breed; - } - public void setBreed(String breed) { - this.breed = breed; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dog dog = (Dog) o; - return Objects.equals(breed, dog.breed); - } - - @Override - public int hashCode() { - return Objects.hash(breed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java deleted file mode 100644 index 875109f4226..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java +++ /dev/null @@ -1,140 +0,0 @@ -package io.swagger.model; - -import java.util.ArrayList; -import java.util.List; - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class EnumArrays { - - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name="EnumArrays") -@XmlEnum -public enum EnumArrays { - {values=[>=, $], enumVars=[{name=GREATER_THAN_OR_EQUAL_TO, value=">="}, {name=DOLLAR, value="$"}]}, - - public String value() { - return name(); - } - - public static EnumArrays fromValue(String v) { - return valueOf(v); - } -} - private JustSymbolEnum justSymbol = null; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name="EnumArrays") -@XmlEnum -public enum EnumArrays { - {values=[fish, crab], enumVars=[{name=FISH, value="fish"}, {name=CRAB, value="crab"}]}, - - public String value() { - return name(); - } - - public static EnumArrays fromValue(String v) { - return valueOf(v); - } -} - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name="EnumArrays") -@XmlEnum -public enum EnumArrays { - {values=[fish, crab], enumVars=[{name=FISH, value="fish"}, {name=CRAB, value="crab"}]}, - - public String value() { - return name(); - } - - public static EnumArrays fromValue(String v) { - return valueOf(v); - } -} - private List arrayEnum = new ArrayList(); - - /** - **/ - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - /** - **/ - public EnumArrays arrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public List getArrayEnum() { - return arrayEnum; - } - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(justSymbol, enumArrays.justSymbol) && - Objects.equals(arrayEnum, enumArrays.arrayEnum); - } - - @Override - public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java deleted file mode 100644 index 8af311452fb..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java +++ /dev/null @@ -1,21 +0,0 @@ -package io.swagger.model; - - - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name="EnumClass") -@XmlEnum -public enum EnumClass { - {values=[_abc, -efg, (xyz)], enumVars=[{name=_ABC, value="_abc"}, {name=_EFG, value="-efg"}, {name=_XYZ_, value="(xyz)"}]}, - - public String value() { - return name(); - } - - public static EnumClass fromValue(String v) { - return valueOf(v); - } -} - diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java deleted file mode 100644 index 22f21b1538d..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java +++ /dev/null @@ -1,177 +0,0 @@ -package io.swagger.model; - -import io.swagger.model.OuterEnum; - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class EnumTest { - - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name="EnumTest") -@XmlEnum -public enum EnumTest { - {values=[UPPER, lower], enumVars=[{name=UPPER, value="UPPER"}, {name=LOWER, value="lower"}]}, - - public String value() { - return name(); - } - - public static EnumTest fromValue(String v) { - return valueOf(v); - } -} - private EnumStringEnum enumString = null; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name="EnumTest") -@XmlEnum -public enum EnumTest { - {values=[1, -1], enumVars=[{name=NUMBER_1, value=1}, {name=NUMBER_MINUS_1, value=-1}]}, - - public String value() { - return name(); - } - - public static EnumTest fromValue(String v) { - return valueOf(v); - } -} - private EnumIntegerEnum enumInteger = null; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name="EnumTest") -@XmlEnum -public enum EnumTest { - {values=[1.1, -1.2], enumVars=[{name=NUMBER_1_DOT_1, value=1.1}, {name=NUMBER_MINUS_1_DOT_2, value=-1.2}]}, - - public String value() { - return name(); - } - - public static EnumTest fromValue(String v) { - return valueOf(v); - } -} - private EnumNumberEnum enumNumber = null; - private OuterEnum outerEnum = null; - - /** - **/ - public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = enumString; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public EnumStringEnum getEnumString() { - return enumString; - } - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - /** - **/ - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - /** - **/ - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - /** - **/ - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public OuterEnum getOuterEnum() { - return outerEnum; - } - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(enumString, enumTest.enumString) && - Objects.equals(enumInteger, enumTest.enumInteger) && - Objects.equals(enumNumber, enumTest.enumNumber) && - Objects.equals(outerEnum, enumTest.outerEnum); - } - - @Override - public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java deleted file mode 100644 index 0d02a5af3e0..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java +++ /dev/null @@ -1,308 +0,0 @@ -package io.swagger.model; - -import java.math.BigDecimal; -import org.joda.time.LocalDate; - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class FormatTest { - - private Integer integer = null; - private Integer int32 = null; - private Long int64 = null; - private BigDecimal number = null; - private Float _float = null; - private Double _double = null; - private String string = null; - private byte[] _byte = null; - private byte[] binary = null; - private LocalDate date = null; - private javax.xml.datatype.XMLGregorianCalendar dateTime = null; - private String uuid = null; - private String password = null; - - /** - * minimum: 10 - * maximum: 100 - **/ - public FormatTest integer(Integer integer) { - this.integer = integer; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public Integer getInteger() { - return integer; - } - public void setInteger(Integer integer) { - this.integer = integer; - } - - /** - * minimum: 20 - * maximum: 200 - **/ - public FormatTest int32(Integer int32) { - this.int32 = int32; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public Integer getInt32() { - return int32; - } - public void setInt32(Integer int32) { - this.int32 = int32; - } - - /** - **/ - public FormatTest int64(Long int64) { - this.int64 = int64; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public Long getInt64() { - return int64; - } - public void setInt64(Long int64) { - this.int64 = int64; - } - - /** - * minimum: 32.1 - * maximum: 543.2 - **/ - public FormatTest number(BigDecimal number) { - this.number = number; - return this; - } - - - @ApiModelProperty(example = "null", required = true, value = "") - public BigDecimal getNumber() { - return number; - } - public void setNumber(BigDecimal number) { - this.number = number; - } - - /** - * minimum: 54.3 - * maximum: 987.6 - **/ - public FormatTest _float(Float _float) { - this._float = _float; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public Float getFloat() { - return _float; - } - public void setFloat(Float _float) { - this._float = _float; - } - - /** - * minimum: 67.8 - * maximum: 123.4 - **/ - public FormatTest _double(Double _double) { - this._double = _double; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public Double getDouble() { - return _double; - } - public void setDouble(Double _double) { - this._double = _double; - } - - /** - **/ - public FormatTest string(String string) { - this.string = string; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public String getString() { - return string; - } - public void setString(String string) { - this.string = string; - } - - /** - **/ - public FormatTest _byte(byte[] _byte) { - this._byte = _byte; - return this; - } - - - @ApiModelProperty(example = "null", required = true, value = "") - public byte[] getByte() { - return _byte; - } - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - /** - **/ - public FormatTest binary(byte[] binary) { - this.binary = binary; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public byte[] getBinary() { - return binary; - } - public void setBinary(byte[] binary) { - this.binary = binary; - } - - /** - **/ - public FormatTest date(LocalDate date) { - this.date = date; - return this; - } - - - @ApiModelProperty(example = "null", required = true, value = "") - public LocalDate getDate() { - return date; - } - public void setDate(LocalDate date) { - this.date = date; - } - - /** - **/ - public FormatTest dateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) { - this.dateTime = dateTime; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public javax.xml.datatype.XMLGregorianCalendar getDateTime() { - return dateTime; - } - public void setDateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) { - this.dateTime = dateTime; - } - - /** - **/ - public FormatTest uuid(String uuid) { - this.uuid = uuid; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public String getUuid() { - return uuid; - } - public void setUuid(String uuid) { - this.uuid = uuid; - } - - /** - **/ - public FormatTest password(String password) { - this.password = password; - return this; - } - - - @ApiModelProperty(example = "null", required = true, value = "") - public String getPassword() { - return password; - } - public void setPassword(String password) { - this.password = password; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(integer, formatTest.integer) && - Objects.equals(int32, formatTest.int32) && - Objects.equals(int64, formatTest.int64) && - Objects.equals(number, formatTest.number) && - Objects.equals(_float, formatTest._float) && - Objects.equals(_double, formatTest._double) && - Objects.equals(string, formatTest.string) && - Objects.equals(_byte, formatTest._byte) && - Objects.equals(binary, formatTest.binary) && - Objects.equals(date, formatTest.date) && - Objects.equals(dateTime, formatTest.dateTime) && - Objects.equals(uuid, formatTest.uuid) && - Objects.equals(password, formatTest.password); - } - - @Override - public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java deleted file mode 100644 index 03adf0ab2cc..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ /dev/null @@ -1,87 +0,0 @@ -package io.swagger.model; - - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class HasOnlyReadOnly { - - private String bar = null; - private String foo = null; - - /** - **/ - public HasOnlyReadOnly bar(String bar) { - this.bar = bar; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public String getBar() { - return bar; - } - public void setBar(String bar) { - this.bar = bar; - } - - /** - **/ - public HasOnlyReadOnly foo(String foo) { - this.foo = foo; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public String getFoo() { - return foo; - } - public void setFoo(String foo) { - this.foo = foo; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(bar, hasOnlyReadOnly.bar) && - Objects.equals(foo, hasOnlyReadOnly.foo); - } - - @Override - public int hashCode() { - return Objects.hash(bar, foo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java deleted file mode 100644 index fde68fee594..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java +++ /dev/null @@ -1,124 +0,0 @@ -package io.swagger.model; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class MapTest { - - private Map> mapMapOfString = new HashMap>(); - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name="MapTest") -@XmlEnum -public enum MapTest { - {values=[UPPER, lower], enumVars=[{name=UPPER, value="UPPER"}, {name=LOWER, value="lower"}]}, - - public String value() { - return name(); - } - - public static MapTest fromValue(String v) { - return valueOf(v); - } -} - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name="MapTest") -@XmlEnum -public enum MapTest { - {values=[UPPER, lower], enumVars=[{name=UPPER, value="UPPER"}, {name=LOWER, value="lower"}]}, - - public String value() { - return name(); - } - - public static MapTest fromValue(String v) { - return valueOf(v); - } -} - private Map mapOfEnumString = new HashMap(); - - /** - **/ - public MapTest mapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public Map> getMapMapOfString() { - return mapMapOfString; - } - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - /** - **/ - public MapTest mapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public Map getMapOfEnumString() { - return mapOfEnumString; - } - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(mapOfEnumString, mapTest.mapOfEnumString); - } - - @Override - public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java deleted file mode 100644 index 011d1fe10c7..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ /dev/null @@ -1,110 +0,0 @@ -package io.swagger.model; - -import io.swagger.model.Animal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class MixedPropertiesAndAdditionalPropertiesClass { - - private String uuid = null; - private javax.xml.datatype.XMLGregorianCalendar dateTime = null; - private Map map = new HashMap(); - - /** - **/ - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { - this.uuid = uuid; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public String getUuid() { - return uuid; - } - public void setUuid(String uuid) { - this.uuid = uuid; - } - - /** - **/ - public MixedPropertiesAndAdditionalPropertiesClass dateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) { - this.dateTime = dateTime; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public javax.xml.datatype.XMLGregorianCalendar getDateTime() { - return dateTime; - } - public void setDateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) { - this.dateTime = dateTime; - } - - /** - **/ - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - this.map = map; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public Map getMap() { - return map; - } - public void setMap(Map map) { - this.map = map; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(map, mixedPropertiesAndAdditionalPropertiesClass.map); - } - - @Override - public int hashCode() { - return Objects.hash(uuid, dateTime, map); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java deleted file mode 100644 index 9d8ebc07c02..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java +++ /dev/null @@ -1,91 +0,0 @@ -package io.swagger.model; - -import io.swagger.annotations.ApiModel; - - -/** - * Model for testing model name starting with number - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "Model for testing model name starting with number") - -public class Model200Response { - - private Integer name = null; - private String propertyClass = null; - - /** - **/ - public Model200Response name(Integer name) { - this.name = name; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public Integer getName() { - return name; - } - public void setName(Integer name) { - this.name = name; - } - - /** - **/ - public Model200Response propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public String getPropertyClass() { - return propertyClass; - } - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200Response = (Model200Response) o; - return Objects.equals(name, _200Response.name) && - Objects.equals(propertyClass, _200Response.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(name, propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java deleted file mode 100644 index 286c9c06502..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java +++ /dev/null @@ -1,72 +0,0 @@ -package io.swagger.model; - -import io.swagger.annotations.ApiModel; - - -/** - * Model for testing reserved words - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "Model for testing reserved words") - -public class ModelReturn { - - private Integer _return = null; - - /** - **/ - public ModelReturn _return(Integer _return) { - this._return = _return; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public Integer getReturn() { - return _return; - } - public void setReturn(Integer _return) { - this._return = _return; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(_return, _return._return); - } - - @Override - public int hashCode() { - return Objects.hash(_return); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - - sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java deleted file mode 100644 index 2960c177bde..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java +++ /dev/null @@ -1,129 +0,0 @@ -package io.swagger.model; - -import io.swagger.annotations.ApiModel; - - -/** - * Model for testing model name same as property name - **/ - -import io.swagger.annotations.*; -import java.util.Objects; -@ApiModel(description = "Model for testing model name same as property name") - -public class Name { - - private Integer name = null; - private Integer snakeCase = null; - private String property = null; - private Integer _123Number = null; - - /** - **/ - public Name name(Integer name) { - this.name = name; - return this; - } - - - @ApiModelProperty(example = "null", required = true, value = "") - public Integer getName() { - return name; - } - public void setName(Integer name) { - this.name = name; - } - - /** - **/ - public Name snakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public Integer getSnakeCase() { - return snakeCase; - } - public void setSnakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - } - - /** - **/ - public Name property(String property) { - this.property = property; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public String getProperty() { - return property; - } - public void setProperty(String property) { - this.property = property; - } - - /** - **/ - public Name _123Number(Integer _123Number) { - this._123Number = _123Number; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public Integer get123Number() { - return _123Number; - } - public void set123Number(Integer _123Number) { - this._123Number = _123Number; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(name, name.name) && - Objects.equals(snakeCase, name.snakeCase) && - Objects.equals(property, name.property) && - Objects.equals(_123Number, name._123Number); - } - - @Override - public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123Number: ").append(toIndentedString(_123Number)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java deleted file mode 100644 index c1ea5771c5a..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java +++ /dev/null @@ -1,69 +0,0 @@ -package io.swagger.model; - -import java.math.BigDecimal; - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class NumberOnly { - - private BigDecimal justNumber = null; - - /** - **/ - public NumberOnly justNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public BigDecimal getJustNumber() { - return justNumber; - } - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(justNumber, numberOnly.justNumber); - } - - @Override - public int hashCode() { - return Objects.hash(justNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - - sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java deleted file mode 100644 index c1db34b0d9f..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java +++ /dev/null @@ -1,21 +0,0 @@ -package io.swagger.model; - - - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name="OuterEnum") -@XmlEnum -public enum OuterEnum { - {values=[placed, approved, delivered], enumVars=[{name=PLACED, value="placed"}, {name=APPROVED, value="approved"}, {name=DELIVERED, value="delivered"}]}, - - public String value() { - return name(); - } - - public static OuterEnum fromValue(String v) { - return valueOf(v); - } -} - diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java deleted file mode 100644 index 52b140917da..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ /dev/null @@ -1,87 +0,0 @@ -package io.swagger.model; - - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class ReadOnlyFirst { - - private String bar = null; - private String baz = null; - - /** - **/ - public ReadOnlyFirst bar(String bar) { - this.bar = bar; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public String getBar() { - return bar; - } - public void setBar(String bar) { - this.bar = bar; - } - - /** - **/ - public ReadOnlyFirst baz(String baz) { - this.baz = baz; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public String getBaz() { - return baz; - } - public void setBaz(String baz) { - this.baz = baz; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(bar, readOnlyFirst.bar) && - Objects.equals(baz, readOnlyFirst.baz); - } - - @Override - public int hashCode() { - return Objects.hash(bar, baz); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java deleted file mode 100644 index 2adfad37dc9..00000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java +++ /dev/null @@ -1,68 +0,0 @@ -package io.swagger.model; - - - - -import io.swagger.annotations.*; -import java.util.Objects; - - -public class SpecialModelName { - - private Long specialPropertyName = null; - - /** - **/ - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; - return this; - } - - - @ApiModelProperty(example = "null", value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; - } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(specialPropertyName, specialModelName.specialPropertyName); - } - - @Override - public int hashCode() { - return Objects.hash(specialPropertyName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} From cab2cbed52e90bb6cddb80fcf1b7c4e8a9296d47 Mon Sep 17 00:00:00 2001 From: "J. Fiala" Date: Sat, 4 Feb 2017 14:42:18 +0100 Subject: [PATCH 21/23] update generated samples --- .../src/gen/java/io/swagger/api/PetApi.java | 39 ++- .../java/io/swagger/api/PetApiService.java | 3 +- .../src/gen/java/io/swagger/api/StoreApi.java | 12 +- .../java/io/swagger/api/StoreApiService.java | 2 +- .../src/gen/java/io/swagger/api/UserApi.java | 26 +- .../gen/java/io/swagger/model/Category.java | 6 +- .../src/gen/java/io/swagger/model/Order.java | 8 +- .../src/gen/java/io/swagger/model/Pet.java | 6 +- .../src/gen/java/io/swagger/model/Tag.java | 6 +- .../src/gen/java/io/swagger/model/User.java | 6 +- .../swagger/api/impl/PetApiServiceImpl.java | 3 +- .../swagger/api/impl/StoreApiServiceImpl.java | 2 +- .../swagger/api/impl/UserApiServiceImpl.java | 124 ++++----- .../petstore/jaxrs-cxf-cdi/swagger.json | 250 +++++++++++------- 14 files changed, 287 insertions(+), 206 deletions(-) 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 0d8f998c5d3..830049c297c 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 @@ -1,6 +1,7 @@ package io.swagger.api; import java.io.File; +import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; import io.swagger.api.PetApiService; @@ -37,7 +38,7 @@ public class PetApi { @POST @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Add a new pet to the store", notes = "", response = void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @@ -46,14 +47,14 @@ public class PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = void.class) }) - public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ) Pet body) { + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { return delegate.addPet(body, securityContext); } @DELETE @Path("/{petId}") - @Produces({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Deletes a pet", notes = "", response = void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @@ -69,7 +70,7 @@ public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @P @GET @Path("/findByStatus") - @Produces({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @@ -79,14 +80,14 @@ public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @P @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") }) - public Response findPetsByStatus( @ApiParam(value = "Status values that need to be considered for filter", allowableValues="available, pending, sold", defaultValue="available") @DefaultValue("available") @QueryParam("status") List status) { + 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); } @GET @Path("/findByTags") - @Produces({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) @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 = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @@ -96,33 +97,29 @@ public Response findPetsByStatus( @ApiParam(value = "Status values that need to @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") }) - public Response findPetsByTags( @ApiParam(value = "Tags to filter by") @QueryParam("tags") List tags) { + public Response findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags) { return delegate.findPetsByTags(tags, securityContext); } @GET @Path("/{petId}") - @Produces({ "application/json", "application/xml" }) - @ApiOperation(value = "Find pet by ID", notes = "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions", response = Pet.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }), + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, 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) }) - public Response getPetById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("petId") Long petId) { + public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId) { return delegate.getPetById(petId, securityContext); } @PUT @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Update an existing pet", notes = "", response = void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @@ -133,14 +130,14 @@ public Response getPetById(@ApiParam(value = "ID of pet that needs to be fetched @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" ) Pet body) { + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { return delegate.updatePet(body, securityContext); } @POST @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @@ -149,22 +146,22 @@ 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) }) - public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") String petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status) { + 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); } @POST @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) - @Produces({ "application/json", "application/xml" }) - @ApiOperation(value = "uploads an image", notes = "", response = void.class, authorizations = { + @Produces({ "application/json" }) + @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = void.class) }) + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file", required = false) InputStream fileInputStream, @Multipart(value = "file" , required = false) Attachment fileDetail) { return delegate.uploadFile(petId, additionalMetadata, fileInputStream, fileDetail, securityContext); } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java index e7f8ee839d5..ac8e4a52ff7 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java @@ -7,6 +7,7 @@ import org.apache.cxf.jaxrs.ext.multipart.Multipart; import java.io.File; +import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; import java.util.List; @@ -24,6 +25,6 @@ public interface PetApiService { public Response findPetsByTags(List tags, SecurityContext securityContext); public Response getPetById(Long petId, SecurityContext securityContext); public Response updatePet(Pet body, SecurityContext securityContext); - public Response updatePetWithForm(String petId, String name, String status, SecurityContext securityContext); + public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext); public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, Attachment fileDetail, SecurityContext 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 9622f17e894..37aadc28199 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 @@ -37,7 +37,7 @@ public class StoreApi { @DELETE @Path("/order/{orderId}") - @Produces({ "application/json", "application/xml" }) + @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), @@ -49,7 +49,7 @@ public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be @GET @Path("/inventory") - @Produces({ "application/json", "application/xml" }) + @Produces({ "application/json" }) @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @@ -62,25 +62,25 @@ public Response getInventory() { @GET @Path("/order/{orderId}") - @Produces({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) @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) }) - public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") String orderId) { + 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); } @POST @Path("/order") - @Produces({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) @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) }) - public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ) Order body) { + 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/StoreApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java index ce9dd593a7a..45580cf4183 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java @@ -20,6 +20,6 @@ public interface StoreApiService { public Response deleteOrder(String orderId, SecurityContext securityContext); public Response getInventory(SecurityContext securityContext); - public Response getOrderById(String orderId, SecurityContext securityContext); + public Response getOrderById(Long orderId, SecurityContext securityContext); public Response placeOrder(Order body, SecurityContext 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 354b124c4d4..c733612ed1a 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 @@ -37,40 +37,40 @@ public class UserApi { @POST - @Produces({ "application/json", "application/xml" }) + @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) }) - public Response createUser(@ApiParam(value = "Created user object" ) User body) { + public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body) { return delegate.createUser(body, securityContext); } @POST @Path("/createWithArray") - @Produces({ "application/json", "application/xml" }) + @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) }) - public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ) List body) { + public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body) { return delegate.createUsersWithArrayInput(body, securityContext); } @POST @Path("/createWithList") - @Produces({ "application/json", "application/xml" }) + @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) }) - public Response createUsersWithListInput(@ApiParam(value = "List of user object" ) List body) { + public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body) { return delegate.createUsersWithListInput(body, securityContext); } @DELETE @Path("/{username}") - @Produces({ "application/json", "application/xml" }) + @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), @@ -82,7 +82,7 @@ public Response deleteUser(@ApiParam(value = "The name that needs to be deleted" @GET @Path("/{username}") - @Produces({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @@ -95,19 +95,19 @@ public Response getUserByName(@ApiParam(value = "The name that needs to be fetch @GET @Path("/login") - @Produces({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) @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) }) - public Response loginUser( @ApiParam(value = "The user name for login") @QueryParam("username") String username, @ApiParam(value = "The password for login in clear text") @QueryParam("password") String password) { + 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); } @GET @Path("/logout") - @Produces({ "application/json", "application/xml" }) + @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) }) @@ -118,12 +118,12 @@ public Response logoutUser() { @PUT @Path("/{username}") - @Produces({ "application/json", "application/xml" }) + @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) }) - public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username, @ApiParam(value = "Updated user object" ) User body) { + public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username, @ApiParam(value = "Updated user object" ,required=true) User body) { return delegate.updateUser(username, body, securityContext); } } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java index a152efac6ed..fee23f1bfaf 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java @@ -2,15 +2,19 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; import javax.validation.constraints.*; +/** + * A category for a pet + **/ import io.swagger.annotations.*; import java.util.Objects; import javax.xml.bind.annotation.*; - +@ApiModel(description = "A category for a pet") public class Category { diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java index 9b81cf4e377..21e1acca64d 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java @@ -2,15 +2,19 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; import javax.validation.constraints.*; +/** + * An order for a pets from the pet store + **/ import io.swagger.annotations.*; import java.util.Objects; import javax.xml.bind.annotation.*; - +@ApiModel(description = "An order for a pets from the pet store") public class Order { @@ -52,7 +56,7 @@ public static StatusEnum fromValue(String v) { } private StatusEnum status = null; - private Boolean complete = null; + private Boolean complete = false; /** **/ diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java index 0346e2aaeb5..c346608f0c8 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java @@ -2,19 +2,23 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +/** + * A pet for sale in the pet store + **/ import io.swagger.annotations.*; import java.util.Objects; import javax.xml.bind.annotation.*; - +@ApiModel(description = "A pet for sale in the pet store") public class Pet { diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java index f5595c760d5..f60b51d5397 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java @@ -2,15 +2,19 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; import javax.validation.constraints.*; +/** + * A tag for a pet + **/ import io.swagger.annotations.*; import java.util.Objects; import javax.xml.bind.annotation.*; - +@ApiModel(description = "A tag for a pet") public class Tag { diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java index a7ebc60e571..2548a22c89c 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java @@ -2,15 +2,19 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; import javax.validation.constraints.*; +/** + * A User who is purchasing from the pet store + **/ import io.swagger.annotations.*; import java.util.Objects; import javax.xml.bind.annotation.*; - +@ApiModel(description = "A User who is purchasing from the pet store") public class User { diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index a07852937ab..c56aee7e580 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -6,6 +6,7 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; import java.io.File; +import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; import java.util.List; @@ -50,7 +51,7 @@ public Response updatePet(Pet body, SecurityContext securityContext) { return Response.ok().entity("magic!").build(); } @Override - public Response updatePetWithForm(String petId, String name, String status, SecurityContext securityContext) { + public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 85f5fa94123..50bd4b8501b 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -30,7 +30,7 @@ public Response getInventory(SecurityContext securityContext) { return Response.ok().entity("magic!").build(); } @Override - public Response getOrderById(String orderId, SecurityContext securityContext) { + public Response getOrderById(Long orderId, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index ab011633fe3..2870f45fb4c 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -1,62 +1,62 @@ -package io.swagger.api.impl; - -import io.swagger.api.*; -import io.swagger.model.*; - -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import java.util.List; -import io.swagger.model.User; - -import java.util.List; - -import java.io.InputStream; - -import javax.enterprise.context.RequestScoped; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@RequestScoped - -public class UserApiServiceImpl implements UserApiService { - @Override - public Response createUser(User body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response createUsersWithArrayInput(List body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response createUsersWithListInput(List body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response deleteUser(String username, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response getUserByName(String username, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response loginUser(String username, String password, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response logoutUser(SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } - @Override - public Response updateUser(String username, User body, SecurityContext securityContext) { - // do some magic! - return Response.ok().entity("magic!").build(); - } -} +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + +import java.util.List; +import io.swagger.model.User; + +import java.util.List; + +import java.io.InputStream; + +import javax.enterprise.context.RequestScoped; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@RequestScoped + +public class UserApiServiceImpl implements UserApiService { + @Override + public Response createUser(User body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response createUsersWithArrayInput(List body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response createUsersWithListInput(List body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response deleteUser(String username, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response getUserByName(String username, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response loginUser(String username, String password, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response logoutUser(SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } + @Override + public Response updateUser(String username, User body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json index fd1df5a86d1..18ccb05b4ba 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json +++ b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json @@ -1,12 +1,12 @@ { "swagger" : "2.0", "info" : { - "description" : "This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters", + "description" : "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", "version" : "1.0.0", "title" : "Swagger Petstore", - "termsOfService" : "http://helloreverb.com/terms/", + "termsOfService" : "http://swagger.io/terms/", "contact" : { - "email" : "apiteam@wordnik.com" + "email" : "apiteam@swagger.io" }, "license" : { "name" : "Apache 2.0", @@ -15,6 +15,24 @@ }, "host" : "petstore.swagger.io", "basePath" : "/v2", + "tags" : [ { + "name" : "pet", + "description" : "Everything about your Pets", + "externalDocs" : { + "description" : "Find out more", + "url" : "http://swagger.io" + } + }, { + "name" : "store", + "description" : "Access to Petstore orders" + }, { + "name" : "user", + "description" : "Operations about user", + "externalDocs" : { + "description" : "Find out more about our store", + "url" : "http://swagger.io" + } + } ], "schemes" : [ "http" ], "paths" : { "/pet" : { @@ -24,12 +42,12 @@ "description" : "", "operationId" : "addPet", "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "in" : "body", "name" : "body", "description" : "Pet object that needs to be added to the store", - "required" : false, + "required" : true, "schema" : { "$ref" : "#/definitions/Pet" } @@ -49,12 +67,12 @@ "description" : "", "operationId" : "updatePet", "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "in" : "body", "name" : "body", "description" : "Pet object that needs to be added to the store", - "required" : false, + "required" : true, "schema" : { "$ref" : "#/definitions/Pet" } @@ -81,19 +99,19 @@ "summary" : "Finds Pets by status", "description" : "Multiple status values can be provided with comma separated strings", "operationId" : "findPetsByStatus", - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "status", "in" : "query", "description" : "Status values that need to be considered for filter", - "required" : false, + "required" : true, "type" : "array", "items" : { "type" : "string", + "default" : "available", "enum" : [ "available", "pending", "sold" ] }, - "collectionFormat" : "multi", - "default" : "available" + "collectionFormat" : "csv" } ], "responses" : { "200" : { @@ -103,15 +121,6 @@ "items" : { "$ref" : "#/definitions/Pet" } - }, - "examples" : { - "application/json" : { - "name" : "Puma", - "type" : "Dog", - "color" : "Black", - "gender" : "Female", - "breed" : "Mixed" - } } }, "400" : { @@ -129,17 +138,17 @@ "summary" : "Finds Pets by tags", "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", "operationId" : "findPetsByTags", - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "tags", "in" : "query", "description" : "Tags to filter by", - "required" : false, + "required" : true, "type" : "array", "items" : { "type" : "string" }, - "collectionFormat" : "multi" + "collectionFormat" : "csv" } ], "responses" : { "200" : { @@ -164,13 +173,13 @@ "get" : { "tags" : [ "pet" ], "summary" : "Find pet by ID", - "description" : "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions", + "description" : "Returns a single pet", "operationId" : "getPetById", - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "petId", "in" : "path", - "description" : "ID of pet that needs to be fetched", + "description" : "ID of pet to return", "required" : true, "type" : "integer", "format" : "int64" @@ -191,8 +200,6 @@ }, "security" : [ { "api_key" : [ ] - }, { - "petstore_auth" : [ "write:pets", "read:pets" ] } ] }, "post" : { @@ -201,13 +208,14 @@ "description" : "", "operationId" : "updatePetWithForm", "consumes" : [ "application/x-www-form-urlencoded" ], - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "petId", "in" : "path", "description" : "ID of pet that needs to be updated", "required" : true, - "type" : "string" + "type" : "integer", + "format" : "int64" }, { "name" : "name", "in" : "formData", @@ -235,11 +243,10 @@ "summary" : "Deletes a pet", "description" : "", "operationId" : "deletePet", - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "api_key", "in" : "header", - "description" : "", "required" : false, "type" : "string" }, { @@ -267,7 +274,7 @@ "description" : "", "operationId" : "uploadFile", "consumes" : [ "multipart/form-data" ], - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/json" ], "parameters" : [ { "name" : "petId", "in" : "path", @@ -289,8 +296,11 @@ "type" : "file" } ], "responses" : { - "default" : { - "description" : "successful operation" + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ApiResponse" + } } }, "security" : [ { @@ -304,7 +314,7 @@ "summary" : "Returns pet inventories by status", "description" : "Returns a map of status codes to quantities", "operationId" : "getInventory", - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/json" ], "parameters" : [ ], "responses" : { "200" : { @@ -329,12 +339,12 @@ "summary" : "Place an order for a pet", "description" : "", "operationId" : "placeOrder", - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "in" : "body", "name" : "body", "description" : "order placed for purchasing the pet", - "required" : false, + "required" : true, "schema" : { "$ref" : "#/definitions/Order" } @@ -358,13 +368,16 @@ "summary" : "Find purchase order by ID", "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", "operationId" : "getOrderById", - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "orderId", "in" : "path", "description" : "ID of pet that needs to be fetched", "required" : true, - "type" : "string" + "type" : "integer", + "maximum" : 5, + "minimum" : 1, + "format" : "int64" } ], "responses" : { "200" : { @@ -386,7 +399,7 @@ "summary" : "Delete purchase order by ID", "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", "operationId" : "deleteOrder", - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "orderId", "in" : "path", @@ -410,12 +423,12 @@ "summary" : "Create user", "description" : "This can only be done by the logged in user.", "operationId" : "createUser", - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "in" : "body", "name" : "body", "description" : "Created user object", - "required" : false, + "required" : true, "schema" : { "$ref" : "#/definitions/User" } @@ -433,12 +446,12 @@ "summary" : "Creates list of users with given input array", "description" : "", "operationId" : "createUsersWithArrayInput", - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "in" : "body", "name" : "body", "description" : "List of user object", - "required" : false, + "required" : true, "schema" : { "type" : "array", "items" : { @@ -459,12 +472,12 @@ "summary" : "Creates list of users with given input array", "description" : "", "operationId" : "createUsersWithListInput", - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "in" : "body", "name" : "body", "description" : "List of user object", - "required" : false, + "required" : true, "schema" : { "type" : "array", "items" : { @@ -485,18 +498,18 @@ "summary" : "Logs user into the system", "description" : "", "operationId" : "loginUser", - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "username", "in" : "query", "description" : "The user name for login", - "required" : false, + "required" : true, "type" : "string" }, { "name" : "password", "in" : "query", "description" : "The password for login in clear text", - "required" : false, + "required" : true, "type" : "string" } ], "responses" : { @@ -504,6 +517,18 @@ "description" : "successful operation", "schema" : { "type" : "string" + }, + "headers" : { + "X-Rate-Limit" : { + "type" : "integer", + "format" : "int32", + "description" : "calls per hour allowed by the user" + }, + "X-Expires-After" : { + "type" : "string", + "format" : "date-time", + "description" : "date in UTC when toekn expires" + } } }, "400" : { @@ -518,7 +543,7 @@ "summary" : "Logs out current logged in user session", "description" : "", "operationId" : "logoutUser", - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ ], "responses" : { "default" : { @@ -533,7 +558,7 @@ "summary" : "Get user by user name", "description" : "", "operationId" : "getUserByName", - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "username", "in" : "path", @@ -561,7 +586,7 @@ "summary" : "Updated user", "description" : "This can only be done by the logged in user.", "operationId" : "updateUser", - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "username", "in" : "path", @@ -572,7 +597,7 @@ "in" : "body", "name" : "body", "description" : "Updated user object", - "required" : false, + "required" : true, "schema" : { "$ref" : "#/definitions/User" } @@ -591,7 +616,7 @@ "summary" : "Delete user", "description" : "This can only be done by the logged in user.", "operationId" : "deleteUser", - "produces" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "username", "in" : "path", @@ -627,7 +652,60 @@ } }, "definitions" : { + "Order" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "petId" : { + "type" : "integer", + "format" : "int64" + }, + "quantity" : { + "type" : "integer", + "format" : "int32" + }, + "shipDate" : { + "type" : "string", + "format" : "date-time" + }, + "status" : { + "type" : "string", + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ] + }, + "complete" : { + "type" : "boolean", + "default" : false + } + }, + "title" : "Pet Order", + "description" : "An order for a pets from the pet store", + "xml" : { + "name" : "Order" + } + }, + "Category" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet catehgry", + "description" : "A category for a pet", + "xml" : { + "name" : "Category" + } + }, "User" : { + "type" : "object", "properties" : { "id" : { "type" : "integer", @@ -657,11 +735,14 @@ "description" : "User Status" } }, + "title" : "a User", + "description" : "A User who is purchasing from the pet store", "xml" : { "name" : "User" } }, - "Category" : { + "Tag" : { + "type" : "object", "properties" : { "id" : { "type" : "integer", @@ -671,11 +752,14 @@ "type" : "string" } }, + "title" : "Pet Tag", + "description" : "A tag for a pet", "xml" : { - "name" : "Category" + "name" : "Tag" } }, "Pet" : { + "type" : "object", "required" : [ "name", "photoUrls" ], "properties" : { "id" : { @@ -715,54 +799,32 @@ "enum" : [ "available", "pending", "sold" ] } }, + "title" : "a Pet", + "description" : "A pet for sale in the pet store", "xml" : { "name" : "Pet" } }, - "Tag" : { + "ApiResponse" : { + "type" : "object", "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - } - }, - "xml" : { - "name" : "Tag" - } - }, - "Order" : { - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "petId" : { - "type" : "integer", - "format" : "int64" - }, - "quantity" : { + "code" : { "type" : "integer", "format" : "int32" }, - "shipDate" : { - "type" : "string", - "format" : "date-time" - }, - "status" : { - "type" : "string", - "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] + "type" : { + "type" : "string" }, - "complete" : { - "type" : "boolean" + "message" : { + "type" : "string" } }, - "xml" : { - "name" : "Order" - } + "title" : "An uploaded response", + "description" : "Describes the result of uploading an image resource" } + }, + "externalDocs" : { + "description" : "Find out more about Swagger", + "url" : "http://swagger.io" } } \ No newline at end of file From 9941deacd4fb93cf63da2e8b5636af012caba5dd Mon Sep 17 00:00:00 2001 From: "J. Fiala" Date: Sat, 4 Feb 2017 14:52:04 +0100 Subject: [PATCH 22/23] adapt Min/Max/DecimalMin/DecimalMax handling for int/long/else --- .../JavaJaxRS/cxf-cdi/beanValidation.mustache | 12 +++++++++++- .../JavaJaxRS/cxf-cdi/beanValidationParams.mustache | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidation.mustache index 079eab89d1a..4709bce0f37 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidation.mustache @@ -34,7 +34,7 @@ @Size(max={{maxItems}}) {{/maxItems}} {{/minItems}} -{{! check for integer / number=decimal type}} +{{! check for integer or long / all others=decimal type with @Decimal*}} {{#isInteger}} {{#minimum}} @Min({{minimum}}) @@ -43,11 +43,21 @@ @Max({{maximum}}) {{/maximum}} {{/isInteger}} +{{#isLong}} +{{#minimum}} + @Min({{minimum}}) +{{/minimum}} +{{#maximum}} + @Max({{maximum}}) +{{/maximum}} +{{/isLong}} {{^isInteger}} +{{^isLong}} {{#minimum}} @DecimalMin("{{minimum}}") {{/minimum}} {{#maximum}} @DecimalMax("{{maximum}}") {{/maximum}} +{{/isLong}} {{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationParams.mustache index 73c9a5af327..687e5c139f3 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationParams.mustache @@ -1 +1,3 @@ -{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +check for integer or long / all others=decimal type with @Decimal* +}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file From e7555838c8e04c686f1b511885e2860e6001558c Mon Sep 17 00:00:00 2001 From: "J. Fiala" Date: Sat, 4 Feb 2017 14:56:33 +0100 Subject: [PATCH 23/23] add ModelApiResponse --- .../io/swagger/model/ModelApiResponse.java | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java new file mode 100644 index 00000000000..39d83d433e5 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -0,0 +1,119 @@ +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; + +/** + * Describes the result of uploading an image resource + **/ + +import io.swagger.annotations.*; +import java.util.Objects; + +import javax.xml.bind.annotation.*; + +@ApiModel(description = "Describes the result of uploading an image resource") + +public class ModelApiResponse { + + private Integer code = null; + private String type = null; + private String message = null; + + /** + **/ + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("code") + public Integer getCode() { + return code; + } + public void setCode(Integer code) { + this.code = code; + } + + /** + **/ + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("type") + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + /** + **/ + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("message") + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(code, _apiResponse.code) && + Objects.equals(type, _apiResponse.type) && + Objects.equals(message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} +