tags,SecurityContext securityContext) throws NotFoundException;
+ public abstract Response getPetById(Long petId,SecurityContext securityContext) throws NotFoundException;
+ public abstract Response updatePet(Pet pet,SecurityContext securityContext) throws NotFoundException;
+ public abstract Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) throws NotFoundException;
+ public abstract Response uploadFile(Long petId,String additionalMetadata,InputStream fileInputStream, FormDataContentDisposition fileDetail,SecurityContext securityContext) throws NotFoundException;
+}
diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/RFC3339DateFormat.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/RFC3339DateFormat.java
new file mode 100644
index 00000000000..b471837701d
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/RFC3339DateFormat.java
@@ -0,0 +1,19 @@
+package org.openapitools.api;
+
+import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
+import com.fasterxml.jackson.databind.util.ISO8601Utils;
+
+import java.text.FieldPosition;
+import java.util.Date;
+
+public class RFC3339DateFormat extends ISO8601DateFormat {
+
+ // Same as ISO8601DateFormat but serializing milliseconds.
+ @Override
+ public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
+ String value = ISO8601Utils.format(date, true);
+ toAppendTo.append(value);
+ return toAppendTo;
+ }
+
+}
\ No newline at end of file
diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApi.java
new file mode 100644
index 00000000000..d0f12395db8
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApi.java
@@ -0,0 +1,115 @@
+package org.openapitools.api;
+
+import org.openapitools.model.*;
+import org.openapitools.api.StoreApiService;
+import org.openapitools.api.factories.StoreApiServiceFactory;
+
+import io.swagger.annotations.ApiParam;
+import io.swagger.jaxrs.*;
+
+import java.util.Map;
+import org.openapitools.model.Order;
+
+import java.util.Map;
+import java.util.List;
+import org.openapitools.api.NotFoundException;
+
+import java.io.InputStream;
+
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
+import org.glassfish.jersey.media.multipart.FormDataParam;
+
+import javax.servlet.ServletConfig;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.*;
+import javax.validation.constraints.*;
+
+@Path("/store")
+
+
+@io.swagger.annotations.Api(description = "the store API")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public class StoreApi {
+ private final StoreApiService delegate;
+
+ public StoreApi(@Context ServletConfig servletContext) {
+ StoreApiService delegate = null;
+
+ if (servletContext != null) {
+ String implClass = servletContext.getInitParameter("StoreApi.implementation");
+ if (implClass != null && !"".equals(implClass.trim())) {
+ try {
+ delegate = (StoreApiService) Class.forName(implClass).newInstance();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ if (delegate == null) {
+ delegate = StoreApiServiceFactory.getStoreApi();
+ }
+
+ this.delegate = delegate;
+ }
+
+ @DELETE
+ @Path("/order/{orderId}")
+
+
+ @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", })
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
+
+ @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) })
+ public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("orderId") String orderId
+,@Context SecurityContext securityContext)
+ throws NotFoundException {
+ return delegate.deleteOrder(orderId,securityContext);
+ }
+ @GET
+ @Path("/inventory")
+
+ @Produces({ "application/json" })
+ @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = {
+ @io.swagger.annotations.Authorization(value = "api_key")
+ }, tags={ "store", })
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") })
+ public Response getInventory(@Context SecurityContext securityContext)
+ throws NotFoundException {
+ return delegate.getInventory(securityContext);
+ }
+ @GET
+ @Path("/order/{orderId}")
+
+ @Produces({ "application/xml", "application/json" })
+ @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", })
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class),
+
+ @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
+
+ @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) })
+ public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") Long orderId
+,@Context SecurityContext securityContext)
+ throws NotFoundException {
+ return delegate.getOrderById(orderId,securityContext);
+ }
+ @POST
+ @Path("/order")
+ @Consumes({ "application/json" })
+ @Produces({ "application/xml", "application/json" })
+ @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", })
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class),
+
+ @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) })
+ public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order
+,@Context SecurityContext securityContext)
+ throws NotFoundException {
+ return delegate.placeOrder(order,securityContext);
+ }
+}
diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApiService.java
new file mode 100644
index 00000000000..13698d783a9
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApiService.java
@@ -0,0 +1,25 @@
+package org.openapitools.api;
+
+import org.openapitools.api.*;
+import org.openapitools.model.*;
+
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
+
+import java.util.Map;
+import org.openapitools.model.Order;
+
+import java.util.List;
+import org.openapitools.api.NotFoundException;
+
+import java.io.InputStream;
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.SecurityContext;
+import javax.validation.constraints.*;
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public abstract class StoreApiService {
+ public abstract Response deleteOrder(String orderId,SecurityContext securityContext) throws NotFoundException;
+ public abstract Response getInventory(SecurityContext securityContext) throws NotFoundException;
+ public abstract Response getOrderById( @Min(1L) @Max(5L)Long orderId,SecurityContext securityContext) throws NotFoundException;
+ public abstract Response placeOrder(Order order,SecurityContext securityContext) throws NotFoundException;
+}
diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StringUtil.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StringUtil.java
new file mode 100644
index 00000000000..8810d4383bd
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StringUtil.java
@@ -0,0 +1,42 @@
+package org.openapitools.api;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public class StringUtil {
+ /**
+ * Check if the given array contains the given value (with case-insensitive comparison).
+ *
+ * @param array The array
+ * @param value The value to search
+ * @return true if the array contains the value
+ */
+ public static boolean containsIgnoreCase(String[] array, String value) {
+ for (String str : array) {
+ if (value == null && str == null) return true;
+ if (value != null && value.equalsIgnoreCase(str)) return true;
+ }
+ return false;
+ }
+
+ /**
+ * Join an array of strings with the given separator.
+ *
+ * Note: This might be replaced by utility method from commons-lang or guava someday
+ * if one of those libraries is added as dependency.
+ *
+ *
+ * @param array The array of strings
+ * @param separator The separator
+ * @return the resulting string
+ */
+ public static String join(String[] array, String separator) {
+ int len = array.length;
+ if (len == 0) return "";
+
+ StringBuilder out = new StringBuilder();
+ out.append(array[0]);
+ for (int i = 1; i < len; i++) {
+ out.append(separator).append(array[i]);
+ }
+ return out.toString();
+ }
+}
diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java
new file mode 100644
index 00000000000..2c5625c2fe4
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java
@@ -0,0 +1,165 @@
+package org.openapitools.api;
+
+import org.openapitools.model.*;
+import org.openapitools.api.UserApiService;
+import org.openapitools.api.factories.UserApiServiceFactory;
+
+import io.swagger.annotations.ApiParam;
+import io.swagger.jaxrs.*;
+
+import java.util.List;
+import org.openapitools.model.User;
+
+import java.util.Map;
+import java.util.List;
+import org.openapitools.api.NotFoundException;
+
+import java.io.InputStream;
+
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
+import org.glassfish.jersey.media.multipart.FormDataParam;
+
+import javax.servlet.ServletConfig;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.*;
+import javax.validation.constraints.*;
+
+@Path("/user")
+
+
+@io.swagger.annotations.Api(description = "the user API")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public class UserApi {
+ private final UserApiService delegate;
+
+ public UserApi(@Context ServletConfig servletContext) {
+ UserApiService delegate = null;
+
+ if (servletContext != null) {
+ String implClass = servletContext.getInitParameter("UserApi.implementation");
+ if (implClass != null && !"".equals(implClass.trim())) {
+ try {
+ delegate = (UserApiService) Class.forName(implClass).newInstance();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ if (delegate == null) {
+ delegate = UserApiServiceFactory.getUserApi();
+ }
+
+ this.delegate = delegate;
+ }
+
+ @POST
+
+ @Consumes({ "application/json" })
+
+ @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) })
+ public Response createUser(@ApiParam(value = "Created user object" ,required=true) User user
+,@Context SecurityContext securityContext)
+ throws NotFoundException {
+ return delegate.createUser(user,securityContext);
+ }
+ @POST
+ @Path("/createWithArray")
+ @Consumes({ "application/json" })
+
+ @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) })
+ public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List user
+,@Context SecurityContext securityContext)
+ throws NotFoundException {
+ return delegate.createUsersWithArrayInput(user,securityContext);
+ }
+ @POST
+ @Path("/createWithList")
+ @Consumes({ "application/json" })
+
+ @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) })
+ public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List user
+,@Context SecurityContext securityContext)
+ throws NotFoundException {
+ return delegate.createUsersWithListInput(user,securityContext);
+ }
+ @DELETE
+ @Path("/{username}")
+
+
+ @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
+
+ @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) })
+ public Response deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathParam("username") String username
+,@Context SecurityContext securityContext)
+ throws NotFoundException {
+ return delegate.deleteUser(username,securityContext);
+ }
+ @GET
+ @Path("/{username}")
+
+ @Produces({ "application/xml", "application/json" })
+ @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", })
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class),
+
+ @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
+
+ @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) })
+ public Response getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathParam("username") String username
+,@Context SecurityContext securityContext)
+ throws NotFoundException {
+ return delegate.getUserByName(username,securityContext);
+ }
+ @GET
+ @Path("/login")
+
+ @Produces({ "application/xml", "application/json" })
+ @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", })
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class),
+
+ @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) })
+ public Response loginUser(@ApiParam(value = "The user name for login",required=true) @QueryParam("username") String username
+,@ApiParam(value = "The password for login in clear text",required=true) @QueryParam("password") String password
+,@Context SecurityContext securityContext)
+ throws NotFoundException {
+ return delegate.loginUser(username,password,securityContext);
+ }
+ @GET
+ @Path("/logout")
+
+
+ @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", })
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) })
+ public Response logoutUser(@Context SecurityContext securityContext)
+ throws NotFoundException {
+ return delegate.logoutUser(securityContext);
+ }
+ @PUT
+ @Path("/{username}")
+ @Consumes({ "application/json" })
+
+ @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
+
+ @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) })
+ 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 user
+,@Context SecurityContext securityContext)
+ throws NotFoundException {
+ return delegate.updateUser(username,user,securityContext);
+ }
+}
diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApiService.java
new file mode 100644
index 00000000000..e5919ae31cb
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApiService.java
@@ -0,0 +1,29 @@
+package org.openapitools.api;
+
+import org.openapitools.api.*;
+import org.openapitools.model.*;
+
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
+
+import java.util.List;
+import org.openapitools.model.User;
+
+import java.util.List;
+import org.openapitools.api.NotFoundException;
+
+import java.io.InputStream;
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.SecurityContext;
+import javax.validation.constraints.*;
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public abstract class UserApiService {
+ public abstract Response createUser(User user,SecurityContext securityContext) throws NotFoundException;
+ public abstract Response createUsersWithArrayInput(List user,SecurityContext securityContext) throws NotFoundException;
+ public abstract Response createUsersWithListInput(List user,SecurityContext securityContext) throws NotFoundException;
+ public abstract Response deleteUser(String username,SecurityContext securityContext) throws NotFoundException;
+ public abstract Response getUserByName(String username,SecurityContext securityContext) throws NotFoundException;
+ public abstract Response loginUser( @NotNull String username, @NotNull String password,SecurityContext securityContext) throws NotFoundException;
+ public abstract Response logoutUser(SecurityContext securityContext) throws NotFoundException;
+ public abstract Response updateUser(String username,User user,SecurityContext securityContext) throws NotFoundException;
+}
diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Category.java
new file mode 100644
index 00000000000..76cf0f87956
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Category.java
@@ -0,0 +1,115 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.model;
+
+import java.util.Objects;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import javax.validation.constraints.*;
+
+/**
+ * A category for a pet
+ */
+@ApiModel(description = "A category for a pet")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public class Category {
+ @JsonProperty("id")
+ private Long id = null;
+
+ @JsonProperty("name")
+ private String name = null;
+
+ public Category id(Long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ **/
+ @JsonProperty("id")
+ @ApiModelProperty(value = "")
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Category name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ **/
+ @JsonProperty("name")
+ @ApiModelProperty(value = "")
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Category category = (Category) o;
+ return Objects.equals(this.id, category.id) &&
+ Objects.equals(this.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(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java
new file mode 100644
index 00000000000..45069447901
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java
@@ -0,0 +1,139 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.model;
+
+import java.util.Objects;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import javax.validation.constraints.*;
+
+/**
+ * Describes the result of uploading an image resource
+ */
+@ApiModel(description = "Describes the result of uploading an image resource")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public class ModelApiResponse {
+ @JsonProperty("code")
+ private Integer code = null;
+
+ @JsonProperty("type")
+ private String type = null;
+
+ @JsonProperty("message")
+ private String message = null;
+
+ public ModelApiResponse code(Integer code) {
+ this.code = code;
+ return this;
+ }
+
+ /**
+ * Get code
+ * @return code
+ **/
+ @JsonProperty("code")
+ @ApiModelProperty(value = "")
+ public Integer getCode() {
+ return code;
+ }
+
+ public void setCode(Integer code) {
+ this.code = code;
+ }
+
+ public ModelApiResponse type(String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Get type
+ * @return type
+ **/
+ @JsonProperty("type")
+ @ApiModelProperty(value = "")
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public ModelApiResponse message(String message) {
+ this.message = message;
+ return this;
+ }
+
+ /**
+ * Get message
+ * @return message
+ **/
+ @JsonProperty("message")
+ @ApiModelProperty(value = "")
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ModelApiResponse _apiResponse = (ModelApiResponse) o;
+ return Objects.equals(this.code, _apiResponse.code) &&
+ Objects.equals(this.type, _apiResponse.type) &&
+ Objects.equals(this.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(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Order.java
new file mode 100644
index 00000000000..1f1c23188d1
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Order.java
@@ -0,0 +1,246 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.model;
+
+import java.util.Objects;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+import javax.validation.constraints.*;
+
+/**
+ * An order for a pets from the pet store
+ */
+@ApiModel(description = "An order for a pets from the pet store")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public class Order {
+ @JsonProperty("id")
+ private Long id = null;
+
+ @JsonProperty("petId")
+ private Long petId = null;
+
+ @JsonProperty("quantity")
+ private Integer quantity = null;
+
+ @JsonProperty("shipDate")
+ private Date shipDate = null;
+
+ /**
+ * Order Status
+ */
+ public enum StatusEnum {
+ PLACED("placed"),
+
+ APPROVED("approved"),
+
+ DELIVERED("delivered");
+
+ private String value;
+
+ StatusEnum(String value) {
+ this.value = value;
+ }
+
+ @Override
+ @JsonValue
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static StatusEnum fromValue(String text) {
+ for (StatusEnum b : StatusEnum.values()) {
+ if (String.valueOf(b.value).equals(text)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + text + "'");
+ }
+ }
+
+ @JsonProperty("status")
+ private StatusEnum status = null;
+
+ @JsonProperty("complete")
+ private Boolean complete = false;
+
+ public Order id(Long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ **/
+ @JsonProperty("id")
+ @ApiModelProperty(value = "")
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Order petId(Long petId) {
+ this.petId = petId;
+ return this;
+ }
+
+ /**
+ * Get petId
+ * @return petId
+ **/
+ @JsonProperty("petId")
+ @ApiModelProperty(value = "")
+ public Long getPetId() {
+ return petId;
+ }
+
+ public void setPetId(Long petId) {
+ this.petId = petId;
+ }
+
+ public Order quantity(Integer quantity) {
+ this.quantity = quantity;
+ return this;
+ }
+
+ /**
+ * Get quantity
+ * @return quantity
+ **/
+ @JsonProperty("quantity")
+ @ApiModelProperty(value = "")
+ public Integer getQuantity() {
+ return quantity;
+ }
+
+ public void setQuantity(Integer quantity) {
+ this.quantity = quantity;
+ }
+
+ public Order shipDate(Date shipDate) {
+ this.shipDate = shipDate;
+ return this;
+ }
+
+ /**
+ * Get shipDate
+ * @return shipDate
+ **/
+ @JsonProperty("shipDate")
+ @ApiModelProperty(value = "")
+ public Date getShipDate() {
+ return shipDate;
+ }
+
+ public void setShipDate(Date shipDate) {
+ this.shipDate = shipDate;
+ }
+
+ public Order status(StatusEnum status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * Order Status
+ * @return status
+ **/
+ @JsonProperty("status")
+ @ApiModelProperty(value = "Order Status")
+ public StatusEnum getStatus() {
+ return status;
+ }
+
+ public void setStatus(StatusEnum status) {
+ this.status = status;
+ }
+
+ public Order complete(Boolean complete) {
+ this.complete = complete;
+ return this;
+ }
+
+ /**
+ * Get complete
+ * @return complete
+ **/
+ @JsonProperty("complete")
+ @ApiModelProperty(value = "")
+ public Boolean getComplete() {
+ return complete;
+ }
+
+ public void setComplete(Boolean complete) {
+ this.complete = complete;
+ }
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Order order = (Order) o;
+ return Objects.equals(this.id, order.id) &&
+ Objects.equals(this.petId, order.petId) &&
+ Objects.equals(this.quantity, order.quantity) &&
+ Objects.equals(this.shipDate, order.shipDate) &&
+ Objects.equals(this.status, order.status) &&
+ Objects.equals(this.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(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java
new file mode 100644
index 00000000000..96271292913
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java
@@ -0,0 +1,264 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.model;
+
+import java.util.Objects;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.ArrayList;
+import java.util.List;
+import org.openapitools.model.Category;
+import org.openapitools.model.Tag;
+import javax.validation.constraints.*;
+
+/**
+ * A pet for sale in the pet store
+ */
+@ApiModel(description = "A pet for sale in the pet store")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public class Pet {
+ @JsonProperty("id")
+ private Long id = null;
+
+ @JsonProperty("category")
+ private Category category = null;
+
+ @JsonProperty("name")
+ private String name = null;
+
+ @JsonProperty("photoUrls")
+ private List photoUrls = new ArrayList();
+
+ @JsonProperty("tags")
+ private List tags = null;
+
+ /**
+ * pet status in the store
+ */
+ public enum StatusEnum {
+ AVAILABLE("available"),
+
+ PENDING("pending"),
+
+ SOLD("sold");
+
+ private String value;
+
+ StatusEnum(String value) {
+ this.value = value;
+ }
+
+ @Override
+ @JsonValue
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static StatusEnum fromValue(String text) {
+ for (StatusEnum b : StatusEnum.values()) {
+ if (String.valueOf(b.value).equals(text)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + text + "'");
+ }
+ }
+
+ @JsonProperty("status")
+ private StatusEnum status = null;
+
+ public Pet id(Long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ **/
+ @JsonProperty("id")
+ @ApiModelProperty(value = "")
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Pet category(Category category) {
+ this.category = category;
+ return this;
+ }
+
+ /**
+ * Get category
+ * @return category
+ **/
+ @JsonProperty("category")
+ @ApiModelProperty(value = "")
+ public Category getCategory() {
+ return category;
+ }
+
+ public void setCategory(Category category) {
+ this.category = category;
+ }
+
+ public Pet name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ **/
+ @JsonProperty("name")
+ @ApiModelProperty(example = "doggie", required = true, value = "")
+ @NotNull
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Pet photoUrls(List photoUrls) {
+ this.photoUrls = photoUrls;
+ return this;
+ }
+
+ public Pet addPhotoUrlsItem(String photoUrlsItem) {
+ this.photoUrls.add(photoUrlsItem);
+ return this;
+ }
+
+ /**
+ * Get photoUrls
+ * @return photoUrls
+ **/
+ @JsonProperty("photoUrls")
+ @ApiModelProperty(required = true, value = "")
+ @NotNull
+ public List getPhotoUrls() {
+ return photoUrls;
+ }
+
+ public void setPhotoUrls(List photoUrls) {
+ this.photoUrls = photoUrls;
+ }
+
+ public Pet tags(List tags) {
+ this.tags = tags;
+ return this;
+ }
+
+ public Pet addTagsItem(Tag tagsItem) {
+ if (this.tags == null) {
+ this.tags = new ArrayList();
+ }
+ this.tags.add(tagsItem);
+ return this;
+ }
+
+ /**
+ * Get tags
+ * @return tags
+ **/
+ @JsonProperty("tags")
+ @ApiModelProperty(value = "")
+ public List getTags() {
+ return tags;
+ }
+
+ public void setTags(List tags) {
+ this.tags = tags;
+ }
+
+ public Pet status(StatusEnum status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * pet status in the store
+ * @return status
+ **/
+ @JsonProperty("status")
+ @ApiModelProperty(value = "pet status in the store")
+ public StatusEnum getStatus() {
+ return status;
+ }
+
+ public void setStatus(StatusEnum status) {
+ this.status = status;
+ }
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Pet pet = (Pet) o;
+ return Objects.equals(this.id, pet.id) &&
+ Objects.equals(this.category, pet.category) &&
+ Objects.equals(this.name, pet.name) &&
+ Objects.equals(this.photoUrls, pet.photoUrls) &&
+ Objects.equals(this.tags, pet.tags) &&
+ Objects.equals(this.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(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Tag.java
new file mode 100644
index 00000000000..5d78706d8f4
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Tag.java
@@ -0,0 +1,115 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.model;
+
+import java.util.Objects;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import javax.validation.constraints.*;
+
+/**
+ * A tag for a pet
+ */
+@ApiModel(description = "A tag for a pet")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public class Tag {
+ @JsonProperty("id")
+ private Long id = null;
+
+ @JsonProperty("name")
+ private String name = null;
+
+ public Tag id(Long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ **/
+ @JsonProperty("id")
+ @ApiModelProperty(value = "")
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Tag name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ **/
+ @JsonProperty("name")
+ @ApiModelProperty(value = "")
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Tag tag = (Tag) o;
+ return Objects.equals(this.id, tag.id) &&
+ Objects.equals(this.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(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/User.java
new file mode 100644
index 00000000000..3709c050508
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/User.java
@@ -0,0 +1,259 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.model;
+
+import java.util.Objects;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import javax.validation.constraints.*;
+
+/**
+ * A User who is purchasing from the pet store
+ */
+@ApiModel(description = "A User who is purchasing from the pet store")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public class User {
+ @JsonProperty("id")
+ private Long id = null;
+
+ @JsonProperty("username")
+ private String username = null;
+
+ @JsonProperty("firstName")
+ private String firstName = null;
+
+ @JsonProperty("lastName")
+ private String lastName = null;
+
+ @JsonProperty("email")
+ private String email = null;
+
+ @JsonProperty("password")
+ private String password = null;
+
+ @JsonProperty("phone")
+ private String phone = null;
+
+ @JsonProperty("userStatus")
+ private Integer userStatus = null;
+
+ public User id(Long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ **/
+ @JsonProperty("id")
+ @ApiModelProperty(value = "")
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public User username(String username) {
+ this.username = username;
+ return this;
+ }
+
+ /**
+ * Get username
+ * @return username
+ **/
+ @JsonProperty("username")
+ @ApiModelProperty(value = "")
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public User firstName(String firstName) {
+ this.firstName = firstName;
+ return this;
+ }
+
+ /**
+ * Get firstName
+ * @return firstName
+ **/
+ @JsonProperty("firstName")
+ @ApiModelProperty(value = "")
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public User lastName(String lastName) {
+ this.lastName = lastName;
+ return this;
+ }
+
+ /**
+ * Get lastName
+ * @return lastName
+ **/
+ @JsonProperty("lastName")
+ @ApiModelProperty(value = "")
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public User email(String email) {
+ this.email = email;
+ return this;
+ }
+
+ /**
+ * Get email
+ * @return email
+ **/
+ @JsonProperty("email")
+ @ApiModelProperty(value = "")
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public User password(String password) {
+ this.password = password;
+ return this;
+ }
+
+ /**
+ * Get password
+ * @return password
+ **/
+ @JsonProperty("password")
+ @ApiModelProperty(value = "")
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public User phone(String phone) {
+ this.phone = phone;
+ return this;
+ }
+
+ /**
+ * Get phone
+ * @return phone
+ **/
+ @JsonProperty("phone")
+ @ApiModelProperty(value = "")
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public User userStatus(Integer userStatus) {
+ this.userStatus = userStatus;
+ return this;
+ }
+
+ /**
+ * User Status
+ * @return userStatus
+ **/
+ @JsonProperty("userStatus")
+ @ApiModelProperty(value = "User Status")
+ public Integer getUserStatus() {
+ return userStatus;
+ }
+
+ public void setUserStatus(Integer userStatus) {
+ this.userStatus = userStatus;
+ }
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ User user = (User) o;
+ return Objects.equals(this.id, user.id) &&
+ Objects.equals(this.username, user.username) &&
+ Objects.equals(this.firstName, user.firstName) &&
+ Objects.equals(this.lastName, user.lastName) &&
+ Objects.equals(this.email, user.email) &&
+ Objects.equals(this.password, user.password) &&
+ Objects.equals(this.phone, user.phone) &&
+ Objects.equals(this.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(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/Bootstrap.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/Bootstrap.java
new file mode 100644
index 00000000000..2856cda2f37
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/Bootstrap.java
@@ -0,0 +1,31 @@
+package org.openapitools.api;
+
+import io.swagger.jaxrs.config.SwaggerContextService;
+import io.swagger.models.*;
+
+import io.swagger.models.auth.*;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+
+public class Bootstrap extends HttpServlet {
+ @Override
+ public void init(ServletConfig config) throws ServletException {
+ Info info = new Info()
+ .title("OpenAPI Server")
+ .description("This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.")
+ .termsOfService("")
+ .contact(new Contact()
+ .email(""))
+ .license(new License()
+ .name("Apache-2.0")
+ .url("http://www.apache.org/licenses/LICENSE-2.0.html"));
+
+ ServletContext context = config.getServletContext();
+ Swagger swagger = new Swagger().info(info);
+
+ new SwaggerContextService().withServletConfig(config).updateSwagger(swagger);
+ }
+}
diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/factories/PetApiServiceFactory.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/factories/PetApiServiceFactory.java
new file mode 100644
index 00000000000..5bd95e5f1c0
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/factories/PetApiServiceFactory.java
@@ -0,0 +1,13 @@
+package org.openapitools.api.factories;
+
+import org.openapitools.api.PetApiService;
+import org.openapitools.api.impl.PetApiServiceImpl;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public class PetApiServiceFactory {
+ private final static PetApiService service = new PetApiServiceImpl();
+
+ public static PetApiService getPetApi() {
+ return service;
+ }
+}
diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/factories/StoreApiServiceFactory.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/factories/StoreApiServiceFactory.java
new file mode 100644
index 00000000000..3a9ab3531af
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/factories/StoreApiServiceFactory.java
@@ -0,0 +1,13 @@
+package org.openapitools.api.factories;
+
+import org.openapitools.api.StoreApiService;
+import org.openapitools.api.impl.StoreApiServiceImpl;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public class StoreApiServiceFactory {
+ private final static StoreApiService service = new StoreApiServiceImpl();
+
+ public static StoreApiService getStoreApi() {
+ return service;
+ }
+}
diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/factories/UserApiServiceFactory.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/factories/UserApiServiceFactory.java
new file mode 100644
index 00000000000..12540d9364c
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/factories/UserApiServiceFactory.java
@@ -0,0 +1,13 @@
+package org.openapitools.api.factories;
+
+import org.openapitools.api.UserApiService;
+import org.openapitools.api.impl.UserApiServiceImpl;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public class UserApiServiceFactory {
+ private final static UserApiService service = new UserApiServiceImpl();
+
+ public static UserApiService getUserApi() {
+ return service;
+ }
+}
diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java
new file mode 100644
index 00000000000..3ef3488fe8f
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java
@@ -0,0 +1,62 @@
+package org.openapitools.api.impl;
+
+import org.openapitools.api.*;
+import org.openapitools.model.*;
+
+import java.io.File;
+import org.openapitools.model.ModelApiResponse;
+import org.openapitools.model.Pet;
+
+import java.util.List;
+import org.openapitools.api.NotFoundException;
+
+import java.io.InputStream;
+
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.SecurityContext;
+import javax.validation.constraints.*;
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public class PetApiServiceImpl extends PetApiService {
+ @Override
+ public Response addPet(Pet pet, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response deletePet(Long petId, String apiKey, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response findPetsByStatus( @NotNull List status, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response findPetsByTags( @NotNull List tags, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response getPetById(Long petId, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response updatePet(Pet pet, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, FormDataContentDisposition fileDetail, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+}
diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java
new file mode 100644
index 00000000000..b4be886cf0c
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java
@@ -0,0 +1,41 @@
+package org.openapitools.api.impl;
+
+import org.openapitools.api.*;
+import org.openapitools.model.*;
+
+import java.util.Map;
+import org.openapitools.model.Order;
+
+import java.util.List;
+import org.openapitools.api.NotFoundException;
+
+import java.io.InputStream;
+
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.SecurityContext;
+import javax.validation.constraints.*;
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public class StoreApiServiceImpl extends StoreApiService {
+ @Override
+ public Response deleteOrder(String orderId, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response getInventory(SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response getOrderById( @Min(1L) @Max(5L)Long orderId, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response placeOrder(Order order, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+}
diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java
new file mode 100644
index 00000000000..fb2e323efc6
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java
@@ -0,0 +1,61 @@
+package org.openapitools.api.impl;
+
+import org.openapitools.api.*;
+import org.openapitools.model.*;
+
+import java.util.List;
+import org.openapitools.model.User;
+
+import java.util.List;
+import org.openapitools.api.NotFoundException;
+
+import java.io.InputStream;
+
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.SecurityContext;
+import javax.validation.constraints.*;
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]")
+public class UserApiServiceImpl extends UserApiService {
+ @Override
+ public Response createUser(User user, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response createUsersWithArrayInput(List user, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response createUsersWithListInput(List user, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response deleteUser(String username, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response getUserByName(String username, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response loginUser( @NotNull String username, @NotNull String password, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response logoutUser(SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+ @Override
+ public Response updateUser(String username, User user, SecurityContext securityContext) throws NotFoundException {
+ // do some magic!
+ return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
+ }
+}
diff --git a/samples/server/petstore/jaxrs-jersey/src/main/webapp/WEB-INF/web.xml b/samples/server/petstore/jaxrs-jersey/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 00000000000..78aae0f4424
--- /dev/null
+++ b/samples/server/petstore/jaxrs-jersey/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,63 @@
+
+
+
+
+ jersey
+ org.glassfish.jersey.servlet.ServletContainer
+
+ jersey.config.server.provider.packages
+
+ io.swagger.jaxrs.listing,
+ io.swagger.sample.resource,
+ org.openapitools.api
+
+
+
+ jersey.config.server.provider.classnames
+ org.glassfish.jersey.media.multipart.MultiPartFeature
+
+
+ jersey.config.server.wadl.disableWadl
+ true
+
+ 1
+
+
+
+ Jersey2Config
+ io.swagger.jersey.config.JerseyJaxrsConfig
+
+ api.version
+ 1.0.0
+
+
+ swagger.api.title
+ OpenAPI Server
+
+
+ swagger.api.basepath
+ http://petstore.swagger.io/v2
+
+
+ 2
+
+
+ Bootstrap
+ org.openapitools.api.Bootstrap
+ 2
+
+
+ jersey
+ /v2/*
+
+
+ ApiOriginFilter
+ org.openapitools.api.ApiOriginFilter
+
+
+ ApiOriginFilter
+ /*
+
+