[Java][JAXRS] improve generated readme (#920)

* [Java][JAXRS] improve readmes

* Update samples

* Update jersey readme

* Update jersey examples
This commit is contained in:
Jérémie Bresson 2018-08-30 08:05:34 +02:00 committed by William Cheng
parent f987306a15
commit f4d7403ed6
44 changed files with 417 additions and 105 deletions

0
bin/openapi3/jaxrs-jersey-petstore.sh Normal file → Executable file
View File

View File

@ -19,6 +19,7 @@ package org.openapitools.codegen.languages;
import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.Schema;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CliOption;
import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenConstants;
@ -130,6 +131,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
super.processOpts(); super.processOpts();
supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen
writeOptional(outputFolder, new SupportingFile("README.mustache", "", "README.md"));
if (generatePom) { if (generatePom) {
writeOptional(outputFolder, new SupportingFile("pom.mustache", "", "pom.xml")); writeOptional(outputFolder, new SupportingFile("pom.mustache", "", "pom.xml"));
} }

View File

@ -1,11 +1,12 @@
# Swagger Jersey generated server # JAX-RS/Jersey server with OpenAPI
## Overview ## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://openapis.org) from a remote server, you can easily generate a server stub. This [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
is an example of building a OpenAPI-enabled JAX-RS server.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
Jersey is used as JAX-RS implementation, `io.swagger:swagger-jersey2-jaxrs` is used to derive the OpenAPI Specification from the annotated code.
To run the server, please execute the following: To run the server, please execute the following:
@ -13,10 +14,10 @@ To run the server, please execute the following:
mvn clean package jetty:run mvn clean package jetty:run
``` ```
You can then view the swagger listing here: You can then view the OpenAPI v2 specification here:
``` ```
http://localhost:{{serverPort}}{{contextPath}}/openapi.json http://localhost:{{serverPort}}{{contextPath}}/swagger.json
``` ```
Note that if you have configured the `host` to be something other than localhost, the calls through Note that if you have configured the `host` to be something other than localhost, the calls through

View File

@ -1,22 +1,23 @@
# OpenAPI generated server # JAX-RS/RESTEasy server with OpenAPI
## Overview ## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://openapis.org) from a remote server, you can easily generate a server stub. This [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
is an example of building a OpenAPI-enabled JAX-RS server.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
RESTEasy is used as JAX-RS implementation library and is defined as dependency.
To run the server, please execute the following: To run the server, please execute the following:
``` ```
mvn clean package jetty:run mvn -Djetty.http.port={{serverPort}} package org.eclipse.jetty:jetty-maven-plugin:run
``` ```
You can then view the swagger listing here: You can then view the OpenAPI v2 specification here:
``` ```
http://localhost:{{serverPort}}{{contextPath}}/openapi.json http://localhost:{{serverPort}}{{contextPath}}/swagger.json
``` ```
Note that if you have configured the `host` to be something other than localhost, the calls through Note that if you have configured the `host` to be something other than localhost, the calls through

View File

@ -1,18 +1,18 @@
# OpenAPI generated server # JAX-RS/Resteasy server with OpenAPI for Jboss EAP
## Overview ## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://openapis.org) from a remote server, you can easily generate a server stub. This [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
is an example of building a OpenAPI-enabled JAX-RS server.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework for Jboss Resteasy. This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework for Jboss Resteasy.
You can deploy the WAR file to Jboss EAP or any other JEE server supporting Jboss Resteasy. You can deploy the WAR file to Jboss EAP or any other JEE server supporting Jboss Resteasy.
You can then view the swagger listing here: You can then view the OpenAPI v2 specification here:
``` ```
http://localhost:{{serverPort}}{{contextPath}}/openapi.json http://localhost:{{serverPort}}{{contextPath}}/swagger.json
``` ```
Note that if you have configured the `host` to be something other than localhost, the calls through Note that if you have configured the `host` to be something other than localhost, the calls through

View File

@ -0,0 +1,33 @@
# JAX-RS server with OpenAPI
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
{{#interfaceOnly}}
This project produces a jar that defines some interfaces.
The jar can be used in combination with an other project providing the implementation.
{{/interfaceOnly}}
{{^interfaceOnly}}
The JAX-RS implementation needs to be provided by the application server you are deploying on.
To run the server from the command line, you can use maven to provision an start a TomEE Server.
Please execute the following:
```
mvn -Dtomee-embedded-plugin.http={{serverPort}} package org.apache.tomee.maven:tomee-embedded-maven-plugin:7.0.5:run
```
You can then call your server endpoints under:
```
http://localhost:{{serverPort}}{{contextPath}}/
```
Note that if you have configured the `host` to be something other than localhost, the calls through
swagger-ui will be directed to that host and not localhost!
{{/interfaceOnly}}

View File

@ -1 +1 @@
3.2.1-SNAPSHOT 3.2.3-SNAPSHOT

View File

@ -1,11 +1,12 @@
# Swagger Jersey generated server # JAX-RS/Jersey server with OpenAPI
## Overview ## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://openapis.org) from a remote server, you can easily generate a server stub. This [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
is an example of building a OpenAPI-enabled JAX-RS server.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
Jersey is used as JAX-RS implementation, `io.swagger:swagger-jersey2-jaxrs` is used to derive the OpenAPI Specification from the annotated code.
To run the server, please execute the following: To run the server, please execute the following:
@ -13,10 +14,10 @@ To run the server, please execute the following:
mvn clean package jetty:run mvn clean package jetty:run
``` ```
You can then view the swagger listing here: You can then view the OpenAPI v2 specification here:
``` ```
http://localhost:8080/v2/openapi.json http://localhost:8080/v2/swagger.json
``` ```
Note that if you have configured the `host` to be something other than localhost, the calls through Note that if you have configured the `host` to be something other than localhost, the calls through

View File

@ -1,6 +1,6 @@
package org.openapitools.api; package org.openapitools.api;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class ApiException extends Exception{ public class ApiException extends Exception{
private int code; private int code;
public ApiException (int code, String msg) { public ApiException (int code, String msg) {

View File

@ -5,7 +5,7 @@ import java.io.IOException;
import javax.servlet.*; import javax.servlet.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class ApiOriginFilter implements javax.servlet.Filter { public class ApiOriginFilter implements javax.servlet.Filter {
public void doFilter(ServletRequest request, ServletResponse response, public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException { FilterChain chain) throws IOException, ServletException {

View File

@ -3,7 +3,7 @@ package org.openapitools.api;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
@javax.xml.bind.annotation.XmlRootElement @javax.xml.bind.annotation.XmlRootElement
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class ApiResponseMessage { public class ApiResponseMessage {
public static final int ERROR = 1; public static final int ERROR = 1;
public static final int WARNING = 2; public static final int WARNING = 2;

View File

@ -1,6 +1,6 @@
package org.openapitools.api; package org.openapitools.api;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class NotFoundException extends ApiException { public class NotFoundException extends ApiException {
private int code; private int code;
public NotFoundException (int code, String msg) { public NotFoundException (int code, String msg) {

View File

@ -31,7 +31,7 @@ import javax.validation.constraints.*;
@io.swagger.annotations.Api(description = "the pet API") @io.swagger.annotations.Api(description = "the pet API")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class PetApi { public class PetApi {
private final PetApiService delegate; private final PetApiService delegate;

View File

@ -17,7 +17,7 @@ import java.io.InputStream;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext; import javax.ws.rs.core.SecurityContext;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public abstract class PetApiService { public abstract class PetApiService {
public abstract Response addPet(Pet pet,SecurityContext securityContext) throws NotFoundException; public abstract Response addPet(Pet pet,SecurityContext securityContext) throws NotFoundException;
public abstract Response deletePet(Long petId,String apiKey,SecurityContext securityContext) throws NotFoundException; public abstract Response deletePet(Long petId,String apiKey,SecurityContext securityContext) throws NotFoundException;

View File

@ -30,7 +30,7 @@ import javax.validation.constraints.*;
@io.swagger.annotations.Api(description = "the store API") @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]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class StoreApi { public class StoreApi {
private final StoreApiService delegate; private final StoreApiService delegate;

View File

@ -16,7 +16,7 @@ import java.io.InputStream;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext; import javax.ws.rs.core.SecurityContext;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public abstract class StoreApiService { public abstract class StoreApiService {
public abstract Response deleteOrder(String orderId,SecurityContext securityContext) throws NotFoundException; public abstract Response deleteOrder(String orderId,SecurityContext securityContext) throws NotFoundException;
public abstract Response getInventory(SecurityContext securityContext) throws NotFoundException; public abstract Response getInventory(SecurityContext securityContext) throws NotFoundException;

View File

@ -1,6 +1,6 @@
package org.openapitools.api; package org.openapitools.api;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class StringUtil { public class StringUtil {
/** /**
* Check if the given array contains the given value (with case-insensitive comparison). * Check if the given array contains the given value (with case-insensitive comparison).

View File

@ -30,7 +30,7 @@ import javax.validation.constraints.*;
@io.swagger.annotations.Api(description = "the user API") @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]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class UserApi { public class UserApi {
private final UserApiService delegate; private final UserApiService delegate;

View File

@ -16,7 +16,7 @@ import java.io.InputStream;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext; import javax.ws.rs.core.SecurityContext;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public abstract class UserApiService { public abstract class UserApiService {
public abstract Response createUser(User user,SecurityContext securityContext) throws NotFoundException; public abstract Response createUser(User user,SecurityContext securityContext) throws NotFoundException;
public abstract Response createUsersWithArrayInput(List<User> user,SecurityContext securityContext) throws NotFoundException; public abstract Response createUsersWithArrayInput(List<User> user,SecurityContext securityContext) throws NotFoundException;

View File

@ -0,0 +1,114 @@
/*
* 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.*;
/**
* Body
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class Body {
@JsonProperty("name")
private String name = null;
@JsonProperty("status")
private String status = null;
public Body name(String name) {
this.name = name;
return this;
}
/**
* Updated name of the pet
* @return name
**/
@JsonProperty("name")
@ApiModelProperty(value = "Updated name of the pet")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Body status(String status) {
this.status = status;
return this;
}
/**
* Updated status of the pet
* @return status
**/
@JsonProperty("status")
@ApiModelProperty(value = "Updated status of the pet")
public String getStatus() {
return status;
}
public void setStatus(String 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;
}
Body body = (Body) o;
return Objects.equals(this.name, body.name) &&
Objects.equals(this.status, body.status);
}
@Override
public int hashCode() {
return Objects.hash(name, status);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Body {\n");
sb.append(" name: ").append(toIndentedString(name)).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 ");
}
}

View File

@ -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 java.io.File;
import javax.validation.constraints.*;
/**
* Body1
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class Body1 {
@JsonProperty("additionalMetadata")
private String additionalMetadata = null;
@JsonProperty("file")
private File file = null;
public Body1 additionalMetadata(String additionalMetadata) {
this.additionalMetadata = additionalMetadata;
return this;
}
/**
* Additional data to pass to server
* @return additionalMetadata
**/
@JsonProperty("additionalMetadata")
@ApiModelProperty(value = "Additional data to pass to server")
public String getAdditionalMetadata() {
return additionalMetadata;
}
public void setAdditionalMetadata(String additionalMetadata) {
this.additionalMetadata = additionalMetadata;
}
public Body1 file(File file) {
this.file = file;
return this;
}
/**
* file to upload
* @return file
**/
@JsonProperty("file")
@ApiModelProperty(value = "file to upload")
public File getFile() {
return file;
}
public void setFile(File file) {
this.file = file;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Body1 body1 = (Body1) o;
return Objects.equals(this.additionalMetadata, body1.additionalMetadata) &&
Objects.equals(this.file, body1.file);
}
@Override
public int hashCode() {
return Objects.hash(additionalMetadata, file);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Body1 {\n");
sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n");
sb.append(" file: ").append(toIndentedString(file)).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 ");
}
}

View File

@ -24,7 +24,7 @@ import javax.validation.constraints.*;
* A category for a pet * A category for a pet
*/ */
@ApiModel(description = "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]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class Category { public class Category {
@JsonProperty("id") @JsonProperty("id")
private Long id = null; private Long id = null;

View File

@ -24,7 +24,7 @@ import javax.validation.constraints.*;
* Describes the result of uploading an image resource * Describes the result of uploading an image resource
*/ */
@ApiModel(description = "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]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class ModelApiResponse { public class ModelApiResponse {
@JsonProperty("code") @JsonProperty("code")
private Integer code = null; private Integer code = null;

View File

@ -26,7 +26,7 @@ import javax.validation.constraints.*;
* An order for a pets from the pet store * An order for a pets from the pet store
*/ */
@ApiModel(description = "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]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class Order { public class Order {
@JsonProperty("id") @JsonProperty("id")
private Long id = null; private Long id = null;

View File

@ -29,7 +29,7 @@ import javax.validation.constraints.*;
* A pet for sale in the pet store * A pet for sale in the pet store
*/ */
@ApiModel(description = "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]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class Pet { public class Pet {
@JsonProperty("id") @JsonProperty("id")
private Long id = null; private Long id = null;

View File

@ -24,7 +24,7 @@ import javax.validation.constraints.*;
* A tag for a pet * A tag for a pet
*/ */
@ApiModel(description = "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]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class Tag { public class Tag {
@JsonProperty("id") @JsonProperty("id")
private Long id = null; private Long id = null;

View File

@ -24,7 +24,7 @@ import javax.validation.constraints.*;
* A User who is purchasing from the pet store * A User who is purchasing from the pet store
*/ */
@ApiModel(description = "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]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class User { public class User {
@JsonProperty("id") @JsonProperty("id")
private Long id = null; private Long id = null;

View File

@ -3,7 +3,7 @@ package org.openapitools.api.factories;
import org.openapitools.api.PetApiService; import org.openapitools.api.PetApiService;
import org.openapitools.api.impl.PetApiServiceImpl; 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]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class PetApiServiceFactory { public class PetApiServiceFactory {
private final static PetApiService service = new PetApiServiceImpl(); private final static PetApiService service = new PetApiServiceImpl();

View File

@ -3,7 +3,7 @@ package org.openapitools.api.factories;
import org.openapitools.api.StoreApiService; import org.openapitools.api.StoreApiService;
import org.openapitools.api.impl.StoreApiServiceImpl; 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]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class StoreApiServiceFactory { public class StoreApiServiceFactory {
private final static StoreApiService service = new StoreApiServiceImpl(); private final static StoreApiService service = new StoreApiServiceImpl();

View File

@ -3,7 +3,7 @@ package org.openapitools.api.factories;
import org.openapitools.api.UserApiService; import org.openapitools.api.UserApiService;
import org.openapitools.api.impl.UserApiServiceImpl; 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]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class UserApiServiceFactory { public class UserApiServiceFactory {
private final static UserApiService service = new UserApiServiceImpl(); private final static UserApiService service = new UserApiServiceImpl();

View File

@ -17,7 +17,7 @@ import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext; import javax.ws.rs.core.SecurityContext;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class PetApiServiceImpl extends PetApiService { public class PetApiServiceImpl extends PetApiService {
@Override @Override
public Response addPet(Pet pet, SecurityContext securityContext) throws NotFoundException { public Response addPet(Pet pet, SecurityContext securityContext) throws NotFoundException {

View File

@ -16,7 +16,7 @@ import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext; import javax.ws.rs.core.SecurityContext;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class StoreApiServiceImpl extends StoreApiService { public class StoreApiServiceImpl extends StoreApiService {
@Override @Override
public Response deleteOrder(String orderId, SecurityContext securityContext) throws NotFoundException { public Response deleteOrder(String orderId, SecurityContext securityContext) throws NotFoundException {

View File

@ -16,7 +16,7 @@ import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext; import javax.ws.rs.core.SecurityContext;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-10T15:02:11.723+09:00[Asia/Tokyo]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2018-08-29T07:47:48.785+02:00[Europe/Zurich]")
public class UserApiServiceImpl extends UserApiService { public class UserApiServiceImpl extends UserApiService {
@Override @Override
public Response createUser(User user, SecurityContext securityContext) throws NotFoundException { public Response createUser(User user, SecurityContext securityContext) throws NotFoundException {

View File

@ -1,22 +1,23 @@
# Swagger generated server # JAX-RS/RESTEasy server with OpenAPI
## Overview ## Overview
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
is an example of building a swagger-enabled JAX-RS server.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
RESTEasy is used as JAX-RS implementation library and is defined as dependency.
To run the server, please execute the following: To run the server, please execute the following:
``` ```
mvn clean package jetty:run mvn -Djetty.http.port=8080 package org.eclipse.jetty:jetty-maven-plugin:run
``` ```
You can then view the swagger listing here: You can then view the OpenAPI v2 specification here:
``` ```
http://localhost:8080/v2/openapi.json http://localhost:8080/v2/swagger.json
``` ```
Note that if you have configured the `host` to be something other than localhost, the calls through Note that if you have configured the `host` to be something other than localhost, the calls through

View File

@ -1,18 +1,18 @@
# Swagger generated server # JAX-RS/Resteasy server with OpenAPI for Jboss EAP
## Overview ## Overview
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
is an example of building a swagger-enabled JAX-RS server.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework for Jboss Resteasy. This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework for Jboss Resteasy.
You can deploy the WAR file to Jboss EAP or any other JEE server supporting Jboss Resteasy. You can deploy the WAR file to Jboss EAP or any other JEE server supporting Jboss Resteasy.
You can then view the swagger listing here: You can then view the OpenAPI v2 specification here:
``` ```
http://localhost:8080/v2/openapi.json http://localhost:8080/v2/swagger.json
``` ```
Note that if you have configured the `host` to be something other than localhost, the calls through Note that if you have configured the `host` to be something other than localhost, the calls through

View File

@ -1,18 +1,18 @@
# Swagger generated server # JAX-RS/Resteasy server with OpenAPI for Jboss EAP
## Overview ## Overview
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
is an example of building a swagger-enabled JAX-RS server.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework for Jboss Resteasy. This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework for Jboss Resteasy.
You can deploy the WAR file to Jboss EAP or any other JEE server supporting Jboss Resteasy. You can deploy the WAR file to Jboss EAP or any other JEE server supporting Jboss Resteasy.
You can then view the swagger listing here: You can then view the OpenAPI v2 specification here:
``` ```
http://localhost:8080/v2/openapi.json http://localhost:8080/v2/swagger.json
``` ```
Note that if you have configured the `host` to be something other than localhost, the calls through Note that if you have configured the `host` to be something other than localhost, the calls through

View File

@ -1,18 +1,18 @@
# Swagger generated server # JAX-RS/Resteasy server with OpenAPI for Jboss EAP
## Overview ## Overview
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
is an example of building a swagger-enabled JAX-RS server.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework for Jboss Resteasy. This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework for Jboss Resteasy.
You can deploy the WAR file to Jboss EAP or any other JEE server supporting Jboss Resteasy. You can deploy the WAR file to Jboss EAP or any other JEE server supporting Jboss Resteasy.
You can then view the swagger listing here: You can then view the OpenAPI v2 specification here:
``` ```
http://localhost:8080/v2/openapi.json http://localhost:8080/v2/swagger.json
``` ```
Note that if you have configured the `host` to be something other than localhost, the calls through Note that if you have configured the `host` to be something other than localhost, the calls through

View File

@ -1,22 +1,23 @@
# Swagger generated server # JAX-RS/RESTEasy server with OpenAPI
## Overview ## Overview
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
is an example of building a swagger-enabled JAX-RS server.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
RESTEasy is used as JAX-RS implementation library and is defined as dependency.
To run the server, please execute the following: To run the server, please execute the following:
``` ```
mvn clean package jetty:run mvn -Djetty.http.port=8080 package org.eclipse.jetty:jetty-maven-plugin:run
``` ```
You can then view the swagger listing here: You can then view the OpenAPI v2 specification here:
``` ```
http://localhost:8080/v2/openapi.json http://localhost:8080/v2/swagger.json
``` ```
Note that if you have configured the `host` to be something other than localhost, the calls through Note that if you have configured the `host` to be something other than localhost, the calls through

View File

@ -0,0 +1,12 @@
# JAX-RS server with OpenAPI
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
This project produces a jar that defines some interfaces.
The jar can be used in combination with an other project providing the implementation.

View File

@ -0,0 +1,27 @@
# JAX-RS server with OpenAPI
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
The JAX-RS implementation needs to be provided by the application server you are deploying on.
To run the server from the command line, you can use maven to provision an start a TomEE Server.
Please execute the following:
```
mvn -Dtomee-embedded-plugin.http=80 package org.apache.tomee.maven:tomee-embedded-maven-plugin:7.0.5:run
```
You can then call your server endpoints under:
```
http://localhost:80/v2/
```
Note that if you have configured the `host` to be something other than localhost, the calls through
swagger-ui will be directed to that host and not localhost!

View File

@ -1,11 +1,12 @@
# Swagger Jersey generated server # JAX-RS/Jersey server with OpenAPI
## Overview ## Overview
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
is an example of building a swagger-enabled JAX-RS server.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
Jersey is used as JAX-RS implementation, `io.swagger:swagger-jersey2-jaxrs` is used to derive the OpenAPI Specification from the annotated code.
To run the server, please execute the following: To run the server, please execute the following:
@ -13,10 +14,10 @@ To run the server, please execute the following:
mvn clean package jetty:run mvn clean package jetty:run
``` ```
You can then view the swagger listing here: You can then view the OpenAPI v2 specification here:
``` ```
http://localhost:8082/v2/openapi.json http://localhost:8082/v2/swagger.json
``` ```
Note that if you have configured the `host` to be something other than localhost, the calls through Note that if you have configured the `host` to be something other than localhost, the calls through

View File

@ -1,11 +1,12 @@
# Swagger Jersey generated server # JAX-RS/Jersey server with OpenAPI
## Overview ## Overview
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
is an example of building a swagger-enabled JAX-RS server.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
Jersey is used as JAX-RS implementation, `io.swagger:swagger-jersey2-jaxrs` is used to derive the OpenAPI Specification from the annotated code.
To run the server, please execute the following: To run the server, please execute the following:
@ -13,10 +14,10 @@ To run the server, please execute the following:
mvn clean package jetty:run mvn clean package jetty:run
``` ```
You can then view the swagger listing here: You can then view the OpenAPI v2 specification here:
``` ```
http://localhost:8082/v2/openapi.json http://localhost:8082/v2/swagger.json
``` ```
Note that if you have configured the `host` to be something other than localhost, the calls through Note that if you have configured the `host` to be something other than localhost, the calls through

View File

@ -1,11 +1,12 @@
# Swagger Jersey generated server # JAX-RS/Jersey server with OpenAPI
## Overview ## Overview
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
is an example of building a swagger-enabled JAX-RS server.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
Jersey is used as JAX-RS implementation, `io.swagger:swagger-jersey2-jaxrs` is used to derive the OpenAPI Specification from the annotated code.
To run the server, please execute the following: To run the server, please execute the following:
@ -13,10 +14,10 @@ To run the server, please execute the following:
mvn clean package jetty:run mvn clean package jetty:run
``` ```
You can then view the swagger listing here: You can then view the OpenAPI v2 specification here:
``` ```
http://localhost:8082/v2/openapi.json http://localhost:8082/v2/swagger.json
``` ```
Note that if you have configured the `host` to be something other than localhost, the calls through Note that if you have configured the `host` to be something other than localhost, the calls through

View File

@ -1,11 +1,12 @@
# Swagger Jersey generated server # JAX-RS/Jersey server with OpenAPI
## Overview ## Overview
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
is an example of building a swagger-enabled JAX-RS server.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
Jersey is used as JAX-RS implementation, `io.swagger:swagger-jersey2-jaxrs` is used to derive the OpenAPI Specification from the annotated code.
To run the server, please execute the following: To run the server, please execute the following:
@ -13,10 +14,10 @@ To run the server, please execute the following:
mvn clean package jetty:run mvn clean package jetty:run
``` ```
You can then view the swagger listing here: You can then view the OpenAPI v2 specification here:
``` ```
http://localhost:8082/v2/openapi.json http://localhost:8082/v2/swagger.json
``` ```
Note that if you have configured the `host` to be something other than localhost, the calls through Note that if you have configured the `host` to be something other than localhost, the calls through