diff --git a/bin/configs/other/java-undertow-server-java-undertow.yaml b/bin/configs/java-undertow-server-java-undertow.yaml similarity index 100% rename from bin/configs/other/java-undertow-server-java-undertow.yaml rename to bin/configs/java-undertow-server-java-undertow.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java index 384d14d4ca1..92e5d2e1bea 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java @@ -106,6 +106,7 @@ public class JavaUndertowServerCodegen extends AbstractJavaCodegen { // keep the yaml in config folder for framework validation. supportingFiles.add(new SupportingFile("openapi.mustache", ("src.main.resources.config").replace(".", java.io.File.separator), "openapi.json")); + supportingFiles.add(new SupportingFile("interface.mustache", (String.format(Locale.ROOT, "src.main.java.%s", apiPackage)).replace(".", java.io.File.separator), "PathHandlerInterface.java")); supportingFiles.add(new SupportingFile("handler.mustache", (String.format(Locale.ROOT, "src.main.java.%s", apiPackage)).replace(".", java.io.File.separator), "PathHandlerProvider.java")); supportingFiles.add(new SupportingFile("service.mustache", ("src.main.resources.META-INF.services").replace(".", java.io.File.separator), "com.networknt.server.HandlerProvider")); diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/README.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/README.mustache index a983dba343c..f452d35095a 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/README.mustache @@ -10,15 +10,13 @@ mvn package exec:exec ## Test -By default, all endpoints are protected by OAuth jwt token verifier. It can be turned off with config change through for development. - +By default, all endpoints are protected by the OAuth JWT token verifier. It can be turned off with a config change, when required. In order to access the server, there is a long lived token below issued by my -oauth2 server [undertow-server-oauth2](https://github.com/networknt/undertow-server-oauth2) +OAuth2 server [undertow-server-oauth2](https://github.com/networknt/undertow-server-oauth2). ``` Bearer eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJ1cm46Y29tOm5ldHdvcmtudDpvYXV0aDI6djEiLCJhdWQiOiJ1cm46Y29tLm5ldHdvcmtudCIsImV4cCI6MTc4ODEzMjczNSwianRpIjoiNWtyM2ZWOHJaelBZNEJrSnNYZzFpQSIsImlhdCI6MTQ3Mjc3MjczNSwibmJmIjoxNDcyNzcyNjE1LCJ2ZXJzaW9uIjoiMS4wIiwidXNlcl9pZCI6InN0ZXZlIiwidXNlcl90eXBlIjoiRU1QTE9ZRUUiLCJjbGllbnRfaWQiOiJkZGNhZjBiYS0xMTMxLTIyMzItMzMxMy1kNmYyNzUzZjI1ZGMiLCJzY29wZSI6WyJhcGkuciIsImFwaS53Il19.gteJiy1uao8HLeWRljpZxHWUgQfofwmnFP-zv3EPUyXjyCOy3xclnfeTnTE39j8PgBwdFASPcDLLk1YfZJbsU6pLlmYXLtdpHDBsVmIRuch6LFPCVQ3JdqSQVci59OhSK0bBThGWqCD3UzDI_OnX4IVCAahcT9Bu94m5u_H_JNmwDf1XaP3Lt4I34buYMuRD9stchsnZi-tuIRkL13FARm1XA9aPZUMUXFdedBWDXo1zMREQ_qCJXOpaZDJM9Im0rIkq9wTEVU00pbRp_Vcdya3dfkFteBMHiwFVt6VNQaco5BXURDAIzXidwQxNEbX1ek03wra8AIani65ZK7fy_w ``` Add "Authorization" header with value as above token and a dummy message will return from the generated stub. - diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/bodyParams.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/bodyParams.mustache index c7d1abfe527..cf3f9c3add9 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}{{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}{{{dataType}}} {{{paramName}}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/enumOuterClass.mustache index 5333fff8c06..f2805b0f72a 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/enumOuterClass.mustache @@ -3,8 +3,8 @@ {{/jackson}} /** -* {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} -*/ + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + */ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/generatedAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/generatedAnnotation.mustache index 875d7b97afe..10843695a9a 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/generatedAnnotation.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/generatedAnnotation.mustache @@ -1 +1 @@ -@javax.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file +@javax.annotation.Generated(value = "{{{generatorClass}}}"{{^hideGenerationTimestamp}}, date = "{{{generatedDate}}}"{{/hideGenerationTimestamp}}) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/handler.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/handler.mustache index 4cb411f79d6..acf876b7975 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/handler.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/handler.mustache @@ -1,34 +1,161 @@ +{{>licenseInfo}} package org.openapitools.handler; -import com.networknt.config.Config; import com.networknt.server.HandlerProvider; import io.undertow.Handlers; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; +import io.undertow.server.RoutingHandler; +import io.undertow.server.handlers.PathHandler; import io.undertow.util.Methods; -public class PathHandlerProvider implements HandlerProvider { +/** + * The default implementation for {@link HandlerProvider} and {@link PathHandlerInterface}. + * + *
There are two flavors of {@link HttpHandler}s to choose from, depending on your needs:
+ * + *Note: Stateful flavor is more performant than Stateless.
+ */ +@SuppressWarnings("TooManyFunctions") +abstract public class PathHandlerProvider implements HandlerProvider, PathHandlerInterface { + /** + * Returns the default base path to access this server. + */ + @javax.annotation.Nonnull + public String getBasePath() { + return "{{{basePathWithoutHost}}}"; + } + /** + * Returns a stateless {@link HttpHandler} that configures all endpoints in this server. + * + *Endpoints bound in this method do NOT start with "{{{basePathWithoutHost}}}", and + * it's your responsibility to configure a {@link PathHandler} with a prefix path + * by calling {@link PathHandler#addPrefixPath} like so:
+ * + *pathHandler.addPrefixPath("{{{basePathWithoutHost}}}", handler)
+ *
+ * Note: the endpoints bound to the returned {@link HttpHandler} are stateless and won't + * retain any state between multiple sessions.
+ * + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + @Override public HttpHandler getHandler() { - HttpHandler handler = Handlers.routing() + return getHandler(false); + } + /** + * Returns a stateless {@link HttpHandler} that configures all endpoints in this server. + * + *Note: the endpoints bound to the returned {@link HttpHandler} are stateless and won't + * retain any state between multiple sessions.
+ * + * @param withBasePath if true, all endpoints would start with "{{{basePathWithoutHost}}}" + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + public HttpHandler getHandler(final boolean withBasePath) { + return getHandler(withBasePath ? getBasePath() : ""); + } + + /** + * Returns a stateless {@link HttpHandler} that configures all endpoints in this server. + * + *Note: the endpoints bound to the returned {@link HttpHandler} are stateless and won't + * retain any state between multiple sessions.
+ * + * @param basePath base path to set for all endpoints + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @SuppressWarnings("Convert2Lambda") + @javax.annotation.Nonnull + public HttpHandler getHandler(final String basePath) { + return Handlers.routing() {{#apiInfo}} -{{#apis}} -{{#operations}} -{{#operation}} - - .add(Methods.{{httpMethod}}, "{{{basePathWithoutHost}}}{{{path}}}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("{{operationId}}"); - } - }) - -{{/operation}} -{{/operations}} -{{/apis}} + {{#apis}} + {{#operations}} + {{#operation}} + .add(Methods.{{{httpMethod}}}, basePath + "{{{path}}}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + {{{operationId}}}().handleRequest(exchange); + } + }) + {{/operation}} + {{/operations}} + {{/apis}} + ; +{{/apiInfo}} + } + + /** + * Returns a stateful {@link HttpHandler} that configures all endpoints in this server. + * + *Endpoints bound in this method do NOT start with "{{{basePathWithoutHost}}}", and + * it's your responsibility to configure a {@link PathHandler} with a prefix path + * by calling {@link PathHandler#addPrefixPath} like so:
+ * + *pathHandler.addPrefixPath("{{{basePathWithoutHost}}}", handler)
+ *
+ * Note: the endpoints bound to the returned {@link HttpHandler} are stateful and will + * retain any state between multiple sessions.
+ * + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + public HttpHandler getStatefulHandler() { + return getStatefulHandler(false); + } + + /** + * Returns a stateful {@link HttpHandler} that configures all endpoints in this server. + * + *Note: the endpoints bound to the returned {@link HttpHandler} are stateful and will + * retain any state between multiple sessions.
+ * + * @param withBasePath if true, all endpoints would start with "{{{basePathWithoutHost}}}" + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + public HttpHandler getStatefulHandler(final boolean withBasePath) { + return getStatefulHandler(withBasePath ? getBasePath() : ""); + } + + /** + * Returns a stateful {@link HttpHandler} that configures all endpoints in this server. + * + *Note: the endpoints bound to the returned {@link HttpHandler} are stateful and will + * retain any state between multiple sessions.
+ * + * @param basePath base path to set for all endpoints + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + public HttpHandler getStatefulHandler(final String basePath) { + return Handlers.routing() +{{#apiInfo}} + {{#apis}} + {{#operations}} + {{#operation}} + .add(Methods.{{{httpMethod}}}, basePath + "{{{path}}}", {{{operationId}}}()) + {{/operation}} + {{/operations}} + {{/apis}} + ; {{/apiInfo}} - ; - return handler; } } - diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/inflector.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/inflector.mustache index 87fc5581316..c4b62bbd8a9 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/inflector.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/inflector.mustache @@ -1,10 +1,10 @@ -controllerPackage: {{invokerPackage}} -modelPackage: {{modelPackage}} +controllerPackage: {{{invokerPackage}}} +modelPackage: {{{modelPackage}}} swaggerUrl: ./src/main/swagger/swagger.yaml modelMappings: # to enable explicit mappings, use this syntax: DefinitionFromSwaggerSpecification: fully.qualified.path.to.Model - {{#models}}{{#model}}{{classname}} : {{modelPackage}}.{{classname}}{{/model}} + {{#models}}{{#model}}{{{classname}}} : {{{modelPackage}}}.{{{classname}}}{{/model}} {{/models}} entityProcessors: diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/interface.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/interface.mustache new file mode 100644 index 00000000000..7dfd94228a8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/interface.mustache @@ -0,0 +1,76 @@ +{{>licenseInfo}} +package org.openapitools.handler; + +import io.undertow.server.*; +import io.undertow.util.*; + +import {{modelPackage}}.*; + +@SuppressWarnings("TooManyFunctions") +public interface PathHandlerInterface { +{{#apiInfo}} + {{#apis}} + {{#operations}} + {{#operation}} + + /** +{{#summary}} *{{{summary}}}
+ * +{{/summary}} +{{#notes}} *{{{notes}}}
+ * +{{/notes}} + *Endpoint: {@link Methods#{{{httpMethod}}} {{{httpMethod}}}} "{{{basePathWithoutHost}}}{{{path}}}" (privileged: {{{hasAuthMethods}}})
+{{#hasParams}} + * + *Request parameters:
+ *"{{{baseName}}}" +{{#description}} *
{{{description}}}
+{{/description}} + *
+ * - Parameter type: {{>isContainerDoc}}{{#isModel}}{@link {{{dataType}}}}{{/isModel}}{{^isModel}}{{#isFile}}{{#isBinary}}Binary{{/isBinary}}File{{/isFile}}{{^isFile}}{@link {{dataType}}}{{/isFile}}{{/isModel}}
+ * - Appears in: {{#isFormParam}}{@link io.undertow.server.handlers.form.FormDataParser Form}{{/isFormParam}}{{#isQueryParam}}{@link HttpServerExchange#getQueryParameters Query}{{/isQueryParam}}{{#isPathParam}}{@link HttpServerExchange#getPathParameters Path}{{/isPathParam}}{{#isHeaderParam}}{@link Headers Header}{{/isHeaderParam}}{{#isCookieParam}}{@link HttpServerExchange#getRequestCookie Cookie}{{/isCookieParam}}{{#isBodyParam}}{@link HttpServerExchange#getRequestChannel Body}{{/isBodyParam}}
+{{#defaultValue}} * - Default value: {{{defaultValue}}}
+{{/defaultValue}}
+ * - Required: {{{required}}}
+ *
Response headers: [{{#responseHeaders}}{{{.}}}{{^-last}}, {{/-last}}{{/responseHeaders}}]
+{{/hasResponseHeaders}} +{{#hasConsumes}} + * + *Consumes: {{{consumes}}}
+{{#hasBodyParam}}{{#bodyParam}} *Payload: {{>isContainerDoc}}{{#isModel}}{@link {{{dataType}}}}{{/isModel}}{{^isModel}}{{#isFile}}{{#isBinary}}Binary {{/isBinary}}File{{/isFile}}{{^isFile}}{@link {{baseType}}}{{/isFile}}{{/isModel}} (required: {{{required}}}{{/bodyParam}})
+{{/hasBodyParam}} +{{/hasConsumes}} + * +{{#hasProduces}} *Produces: {{{produces}}}
+{{/hasProduces}} +{{#returnBaseType}} *Returns: {{>isContainerDoc}}{@link {{{returnBaseType}}}}
+{{/returnBaseType}} + * + *Responses:
+ *Add a new pet to the store
+ * + *Endpoint: {@link Methods#POST POST} "/v2/pet" (privileged: true)
+ * + *Request parameters:
+ *Consumes: [{mediaType=application/json}, {mediaType=application/xml}]
+ *Payload: {@link Pet} (required: true)
+ * + * + *Responses:
+ *Deletes a pet
+ * + *Endpoint: {@link Methods#DELETE DELETE} "/v2/pet/{petId}" (privileged: true)
+ * + *Request parameters:
+ *"petId" + *
Pet id to delete
+ *
+ * - Parameter type: {@link Long}
+ * - Appears in: {@link HttpServerExchange#getPathParameters Path}
+ * - Required: true
+ *
"api_key" + *
+ * - Parameter type: {@link String}
+ * - Appears in: {@link Headers Header}
+ * - Required: false
+ *
Responses:
+ *Finds Pets by status
+ * + *Multiple status values can be provided with comma separated strings
+ * + *Endpoint: {@link Methods#GET GET} "/v2/pet/findByStatus" (privileged: true)
+ * + *Request parameters:
+ *"status" + *
Status values that need to be considered for filter
+ *
+ * - Parameter type: {@link java.util.List List} of {@link List<String>}
+ * - Appears in: {@link HttpServerExchange#getQueryParameters Query}
+ * - Default value: new ArrayList
+ * - Required: true
+ *
Produces: [{mediaType=application/xml}, {mediaType=application/json}]
+ *Returns: {@link java.util.List List} of {@link Pet}
+ * + *Responses:
+ *Finds Pets by tags
+ * + *Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ * + *Endpoint: {@link Methods#GET GET} "/v2/pet/findByTags" (privileged: true)
+ * + *Request parameters:
+ *"tags" + *
Tags to filter by
+ *
+ * - Parameter type: {@link java.util.List List} of {@link List<String>}
+ * - Appears in: {@link HttpServerExchange#getQueryParameters Query}
+ * - Default value: new ArrayList
+ * - Required: true
+ *
Produces: [{mediaType=application/xml}, {mediaType=application/json}]
+ *Returns: {@link java.util.List List} of {@link Pet}
+ * + *Responses:
+ *Find pet by ID
+ * + *Returns a single pet
+ * + *Endpoint: {@link Methods#GET GET} "/v2/pet/{petId}" (privileged: true)
+ * + *Request parameters:
+ *"petId" + *
ID of pet to return
+ *
+ * - Parameter type: {@link Long}
+ * - Appears in: {@link HttpServerExchange#getPathParameters Path}
+ * - Required: true
+ *
Produces: [{mediaType=application/xml}, {mediaType=application/json}]
+ *Returns: {@link Pet}
+ * + *Responses:
+ *Update an existing pet
+ * + *Endpoint: {@link Methods#PUT PUT} "/v2/pet" (privileged: true)
+ * + *Request parameters:
+ *Consumes: [{mediaType=application/json}, {mediaType=application/xml}]
+ *Payload: {@link Pet} (required: true)
+ * + * + *Responses:
+ *Updates a pet in the store with form data
+ * + *Endpoint: {@link Methods#POST POST} "/v2/pet/{petId}" (privileged: true)
+ * + *Request parameters:
+ *"petId" + *
ID of pet that needs to be updated
+ *
+ * - Parameter type: {@link Long}
+ * - Appears in: {@link HttpServerExchange#getPathParameters Path}
+ * - Required: true
+ *
"name" + *
Updated name of the pet
+ *
+ * - Parameter type: {@link String}
+ * - Appears in: {@link io.undertow.server.handlers.form.FormDataParser Form}
+ * - Required: false
+ *
"status" + *
Updated status of the pet
+ *
+ * - Parameter type: {@link String}
+ * - Appears in: {@link io.undertow.server.handlers.form.FormDataParser Form}
+ * - Required: false
+ *
Consumes: [{mediaType=application/x-www-form-urlencoded}]
+ * + * + *Responses:
+ *uploads an image
+ * + *Endpoint: {@link Methods#POST POST} "/v2/pet/{petId}/uploadImage" (privileged: true)
+ * + *Request parameters:
+ *"petId" + *
ID of pet to update
+ *
+ * - Parameter type: {@link Long}
+ * - Appears in: {@link HttpServerExchange#getPathParameters Path}
+ * - Required: true
+ *
"additionalMetadata" + *
Additional data to pass to server
+ *
+ * - Parameter type: {@link String}
+ * - Appears in: {@link io.undertow.server.handlers.form.FormDataParser Form}
+ * - Required: false
+ *
"file" + *
file to upload
+ *
+ * - Parameter type: BinaryFile
+ * - Appears in: {@link io.undertow.server.handlers.form.FormDataParser Form}
+ * - Required: false
+ *
Consumes: [{mediaType=multipart/form-data}]
+ * + *Produces: [{mediaType=application/json}]
+ *Returns: {@link ModelApiResponse}
+ * + *Responses:
+ *Delete purchase order by ID
+ * + *For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ * + *Endpoint: {@link Methods#DELETE DELETE} "/v2/store/order/{orderId}" (privileged: false)
+ * + *Request parameters:
+ *"orderId" + *
ID of the order that needs to be deleted
+ *
+ * - Parameter type: {@link String}
+ * - Appears in: {@link HttpServerExchange#getPathParameters Path}
+ * - Required: true
+ *
Responses:
+ *Returns pet inventories by status
+ * + *Returns a map of status codes to quantities
+ * + *Endpoint: {@link Methods#GET GET} "/v2/store/inventory" (privileged: true)
+ * + *Produces: [{mediaType=application/json}]
+ *Returns: {@link java.util.Map Map} of {@link Integer}
+ * + *Responses:
+ *Find purchase order by ID
+ * + *For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+ * + *Endpoint: {@link Methods#GET GET} "/v2/store/order/{orderId}" (privileged: false)
+ * + *Request parameters:
+ *"orderId" + *
ID of pet that needs to be fetched
+ *
+ * - Parameter type: {@link Long}
+ * - Appears in: {@link HttpServerExchange#getPathParameters Path}
+ * - Required: true
+ *
Produces: [{mediaType=application/xml}, {mediaType=application/json}]
+ *Returns: {@link Order}
+ * + *Responses:
+ *Place an order for a pet
+ * + *Endpoint: {@link Methods#POST POST} "/v2/store/order" (privileged: false)
+ * + *Request parameters:
+ *Produces: [{mediaType=application/xml}, {mediaType=application/json}]
+ *Returns: {@link Order}
+ * + *Responses:
+ *Create user
+ * + *This can only be done by the logged in user.
+ * + *Endpoint: {@link Methods#POST POST} "/v2/user" (privileged: false)
+ * + *Request parameters:
+ *Responses:
+ *Creates list of users with given input array
+ * + *Endpoint: {@link Methods#POST POST} "/v2/user/createWithArray" (privileged: false)
+ * + *Request parameters:
+ *Responses:
+ *Creates list of users with given input array
+ * + *Endpoint: {@link Methods#POST POST} "/v2/user/createWithList" (privileged: false)
+ * + *Request parameters:
+ *Responses:
+ *Delete user
+ * + *This can only be done by the logged in user.
+ * + *Endpoint: {@link Methods#DELETE DELETE} "/v2/user/{username}" (privileged: false)
+ * + *Request parameters:
+ *"username" + *
The name that needs to be deleted
+ *
+ * - Parameter type: {@link String}
+ * - Appears in: {@link HttpServerExchange#getPathParameters Path}
+ * - Required: true
+ *
Responses:
+ *Get user by user name
+ * + *Endpoint: {@link Methods#GET GET} "/v2/user/{username}" (privileged: false)
+ * + *Request parameters:
+ *"username" + *
The name that needs to be fetched. Use user1 for testing.
+ *
+ * - Parameter type: {@link String}
+ * - Appears in: {@link HttpServerExchange#getPathParameters Path}
+ * - Required: true
+ *
Produces: [{mediaType=application/xml}, {mediaType=application/json}]
+ *Returns: {@link User}
+ * + *Responses:
+ *Logs user into the system
+ * + *Endpoint: {@link Methods#GET GET} "/v2/user/login" (privileged: false)
+ * + *Request parameters:
+ *"username" + *
The user name for login
+ *
+ * - Parameter type: {@link String}
+ * - Appears in: {@link HttpServerExchange#getQueryParameters Query}
+ * - Required: true
+ *
"password" + *
The password for login in clear text
+ *
+ * - Parameter type: {@link String}
+ * - Appears in: {@link HttpServerExchange#getQueryParameters Query}
+ * - Required: true
+ *
Response headers: [CodegenProperty{openApiType='integer', baseName='X-Rate-Limit', complexType='null', getter='getxRateLimit', setter='setxRateLimit', description='calls per hour allowed by the user', dataType='Integer', datatypeWithEnum='Integer', dataFormat='int32', name='xRateLimit', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Rate-Limit;', baseType='Integer', containerType='null', title='null', unescapedDescription='calls per hour allowed by the user', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{ + "type" : "integer", + "format" : "int32" +}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=false, isNumeric=true, isInteger=true, isLong=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='XRateLimit', nameInSnakeCase='X_RATE_LIMIT', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false}, CodegenProperty{openApiType='string', baseName='X-Expires-After', complexType='Date', getter='getxExpiresAfter', setter='setxExpiresAfter', description='date in UTC when toekn expires', dataType='Date', datatypeWithEnum='Date', dataFormat='date-time', name='xExpiresAfter', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Expires-After;', baseType='Date', containerType='null', title='null', unescapedDescription='date in UTC when toekn expires', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{ + "type" : "string", + "format" : "date-time" +}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=false, isModel=false, isContainer=false, isString=false, isNumeric=false, isInteger=false, isLong=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=true, isUuid=false, isUri=false, isEmail=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='XExpiresAfter', nameInSnakeCase='X_EXPIRES_AFTER', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false}]
+ * + *Produces: [{mediaType=application/xml}, {mediaType=application/json}]
+ *Returns: {@link String}
+ * + *Responses:
+ *Logs out current logged in user session
+ * + *Endpoint: {@link Methods#GET GET} "/v2/user/logout" (privileged: false)
+ * + * + *Responses:
+ *Updated user
+ * + *This can only be done by the logged in user.
+ * + *Endpoint: {@link Methods#PUT PUT} "/v2/user/{username}" (privileged: false)
+ * + *Request parameters:
+ *"username" + *
name that need to be deleted
+ *
+ * - Parameter type: {@link String}
+ * - Appears in: {@link HttpServerExchange#getPathParameters Path}
+ * - Required: true
+ *
Responses:
+ *There are two flavors of {@link HttpHandler}s to choose from, depending on your needs:
+ * + *Note: Stateful flavor is more performant than Stateless.
+ */ +@SuppressWarnings("TooManyFunctions") +abstract public class PathHandlerProvider implements HandlerProvider, PathHandlerInterface { + /** + * Returns the default base path to access this server. + */ + @javax.annotation.Nonnull + public String getBasePath() { + return "/v2"; + } + /** + * Returns a stateless {@link HttpHandler} that configures all endpoints in this server. + * + *Endpoints bound in this method do NOT start with "/v2", and + * it's your responsibility to configure a {@link PathHandler} with a prefix path + * by calling {@link PathHandler#addPrefixPath} like so:
+ * + *pathHandler.addPrefixPath("/v2", handler)
+ *
+ * Note: the endpoints bound to the returned {@link HttpHandler} are stateless and won't + * retain any state between multiple sessions.
+ * + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + @Override public HttpHandler getHandler() { - HttpHandler handler = Handlers.routing() + return getHandler(false); + } + /** + * Returns a stateless {@link HttpHandler} that configures all endpoints in this server. + * + *Note: the endpoints bound to the returned {@link HttpHandler} are stateless and won't + * retain any state between multiple sessions.
+ * + * @param withBasePath if true, all endpoints would start with "/v2" + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + public HttpHandler getHandler(final boolean withBasePath) { + return getHandler(withBasePath ? getBasePath() : ""); + } - .add(Methods.POST, "/v2/pet", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("addPet"); - } - }) + /** + * Returns a stateless {@link HttpHandler} that configures all endpoints in this server. + * + *Note: the endpoints bound to the returned {@link HttpHandler} are stateless and won't + * retain any state between multiple sessions.
+ * + * @param basePath base path to set for all endpoints + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @SuppressWarnings("Convert2Lambda") + @javax.annotation.Nonnull + public HttpHandler getHandler(final String basePath) { + return Handlers.routing() + .add(Methods.POST, basePath + "/pet", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + addPet().handleRequest(exchange); + } + }) + .add(Methods.DELETE, basePath + "/pet/{petId}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + deletePet().handleRequest(exchange); + } + }) + .add(Methods.GET, basePath + "/pet/findByStatus", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + findPetsByStatus().handleRequest(exchange); + } + }) + .add(Methods.GET, basePath + "/pet/findByTags", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + findPetsByTags().handleRequest(exchange); + } + }) + .add(Methods.GET, basePath + "/pet/{petId}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + getPetById().handleRequest(exchange); + } + }) + .add(Methods.PUT, basePath + "/pet", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + updatePet().handleRequest(exchange); + } + }) + .add(Methods.POST, basePath + "/pet/{petId}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + updatePetWithForm().handleRequest(exchange); + } + }) + .add(Methods.POST, basePath + "/pet/{petId}/uploadImage", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + uploadFile().handleRequest(exchange); + } + }) + .add(Methods.DELETE, basePath + "/store/order/{orderId}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + deleteOrder().handleRequest(exchange); + } + }) + .add(Methods.GET, basePath + "/store/inventory", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + getInventory().handleRequest(exchange); + } + }) + .add(Methods.GET, basePath + "/store/order/{orderId}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + getOrderById().handleRequest(exchange); + } + }) + .add(Methods.POST, basePath + "/store/order", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + placeOrder().handleRequest(exchange); + } + }) + .add(Methods.POST, basePath + "/user", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + createUser().handleRequest(exchange); + } + }) + .add(Methods.POST, basePath + "/user/createWithArray", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + createUsersWithArrayInput().handleRequest(exchange); + } + }) + .add(Methods.POST, basePath + "/user/createWithList", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + createUsersWithListInput().handleRequest(exchange); + } + }) + .add(Methods.DELETE, basePath + "/user/{username}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + deleteUser().handleRequest(exchange); + } + }) + .add(Methods.GET, basePath + "/user/{username}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + getUserByName().handleRequest(exchange); + } + }) + .add(Methods.GET, basePath + "/user/login", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + loginUser().handleRequest(exchange); + } + }) + .add(Methods.GET, basePath + "/user/logout", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + logoutUser().handleRequest(exchange); + } + }) + .add(Methods.PUT, basePath + "/user/{username}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + updateUser().handleRequest(exchange); + } + }) + ; + } + /** + * Returns a stateful {@link HttpHandler} that configures all endpoints in this server. + * + *Endpoints bound in this method do NOT start with "/v2", and + * it's your responsibility to configure a {@link PathHandler} with a prefix path + * by calling {@link PathHandler#addPrefixPath} like so:
+ * + *pathHandler.addPrefixPath("/v2", handler)
+ *
+ * Note: the endpoints bound to the returned {@link HttpHandler} are stateful and will + * retain any state between multiple sessions.
+ * + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + public HttpHandler getStatefulHandler() { + return getStatefulHandler(false); + } - .add(Methods.DELETE, "/v2/pet/{petId}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("deletePet"); - } - }) + /** + * Returns a stateful {@link HttpHandler} that configures all endpoints in this server. + * + *Note: the endpoints bound to the returned {@link HttpHandler} are stateful and will + * retain any state between multiple sessions.
+ * + * @param withBasePath if true, all endpoints would start with "/v2" + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + public HttpHandler getStatefulHandler(final boolean withBasePath) { + return getStatefulHandler(withBasePath ? getBasePath() : ""); + } - - .add(Methods.GET, "/v2/pet/findByStatus", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("findPetsByStatus"); - } - }) - - - .add(Methods.GET, "/v2/pet/findByTags", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("findPetsByTags"); - } - }) - - - .add(Methods.GET, "/v2/pet/{petId}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("getPetById"); - } - }) - - - .add(Methods.PUT, "/v2/pet", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("updatePet"); - } - }) - - - .add(Methods.POST, "/v2/pet/{petId}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("updatePetWithForm"); - } - }) - - - .add(Methods.POST, "/v2/pet/{petId}/uploadImage", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("uploadFile"); - } - }) - - - .add(Methods.DELETE, "/v2/store/order/{orderId}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("deleteOrder"); - } - }) - - - .add(Methods.GET, "/v2/store/inventory", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("getInventory"); - } - }) - - - .add(Methods.GET, "/v2/store/order/{orderId}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("getOrderById"); - } - }) - - - .add(Methods.POST, "/v2/store/order", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("placeOrder"); - } - }) - - - .add(Methods.POST, "/v2/user", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("createUser"); - } - }) - - - .add(Methods.POST, "/v2/user/createWithArray", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("createUsersWithArrayInput"); - } - }) - - - .add(Methods.POST, "/v2/user/createWithList", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("createUsersWithListInput"); - } - }) - - - .add(Methods.DELETE, "/v2/user/{username}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("deleteUser"); - } - }) - - - .add(Methods.GET, "/v2/user/{username}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("getUserByName"); - } - }) - - - .add(Methods.GET, "/v2/user/login", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("loginUser"); - } - }) - - - .add(Methods.GET, "/v2/user/logout", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("logoutUser"); - } - }) - - - .add(Methods.PUT, "/v2/user/{username}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("updateUser"); - } - }) - - ; - return handler; + /** + * Returns a stateful {@link HttpHandler} that configures all endpoints in this server. + * + *Note: the endpoints bound to the returned {@link HttpHandler} are stateful and will + * retain any state between multiple sessions.
+ * + * @param basePath base path to set for all endpoints + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + public HttpHandler getStatefulHandler(final String basePath) { + return Handlers.routing() + .add(Methods.POST, basePath + "/pet", addPet()) + .add(Methods.DELETE, basePath + "/pet/{petId}", deletePet()) + .add(Methods.GET, basePath + "/pet/findByStatus", findPetsByStatus()) + .add(Methods.GET, basePath + "/pet/findByTags", findPetsByTags()) + .add(Methods.GET, basePath + "/pet/{petId}", getPetById()) + .add(Methods.PUT, basePath + "/pet", updatePet()) + .add(Methods.POST, basePath + "/pet/{petId}", updatePetWithForm()) + .add(Methods.POST, basePath + "/pet/{petId}/uploadImage", uploadFile()) + .add(Methods.DELETE, basePath + "/store/order/{orderId}", deleteOrder()) + .add(Methods.GET, basePath + "/store/inventory", getInventory()) + .add(Methods.GET, basePath + "/store/order/{orderId}", getOrderById()) + .add(Methods.POST, basePath + "/store/order", placeOrder()) + .add(Methods.POST, basePath + "/user", createUser()) + .add(Methods.POST, basePath + "/user/createWithArray", createUsersWithArrayInput()) + .add(Methods.POST, basePath + "/user/createWithList", createUsersWithListInput()) + .add(Methods.DELETE, basePath + "/user/{username}", deleteUser()) + .add(Methods.GET, basePath + "/user/{username}", getUserByName()) + .add(Methods.GET, basePath + "/user/login", loginUser()) + .add(Methods.GET, basePath + "/user/logout", logoutUser()) + .add(Methods.PUT, basePath + "/user/{username}", updateUser()) + ; } } - diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Category.java index bda35d2f045..4700938d352 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Category.java @@ -1,3 +1,13 @@ +/* + * 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 document version: 1.0.0 + * + * + * AUTO-GENERATED FILE, DO NOT MODIFY! + */ package org.openapitools.model; import java.util.Objects; @@ -10,7 +20,7 @@ import io.swagger.annotations.ApiModelProperty; /** * A category for a pet - **/ + */ @ApiModel(description = "A category for a pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen") @@ -20,7 +30,7 @@ public class Category { private String name; /** - **/ + */ public Category id(Long id) { this.id = id; return this; @@ -37,7 +47,7 @@ public class Category { } /** - **/ + */ public Category name(String name) { this.name = name; return this; diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/ModelApiResponse.java index 0d4cb3865cb..04568d59bb5 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,3 +1,13 @@ +/* + * 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 document version: 1.0.0 + * + * + * AUTO-GENERATED FILE, DO NOT MODIFY! + */ package org.openapitools.model; import java.util.Objects; @@ -10,7 +20,7 @@ import io.swagger.annotations.ApiModelProperty; /** * 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.JavaUndertowServerCodegen") @@ -21,7 +31,7 @@ public class ModelApiResponse { private String message; /** - **/ + */ public ModelApiResponse code(Integer code) { this.code = code; return this; @@ -38,7 +48,7 @@ public class ModelApiResponse { } /** - **/ + */ public ModelApiResponse type(String type) { this.type = type; return this; @@ -55,7 +65,7 @@ public class ModelApiResponse { } /** - **/ + */ public ModelApiResponse message(String message) { this.message = message; return this; diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Order.java index f057848f0cf..2f7209f8ef7 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Order.java @@ -1,3 +1,13 @@ +/* + * 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 document version: 1.0.0 + * + * + * AUTO-GENERATED FILE, DO NOT MODIFY! + */ package org.openapitools.model; import java.util.Objects; @@ -12,7 +22,7 @@ import java.util.Date; /** * 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.JavaUndertowServerCodegen") @@ -46,7 +56,7 @@ public class Order { private Boolean complete = false; /** - **/ + */ public Order id(Long id) { this.id = id; return this; @@ -63,7 +73,7 @@ public class Order { } /** - **/ + */ public Order petId(Long petId) { this.petId = petId; return this; @@ -80,7 +90,7 @@ public class Order { } /** - **/ + */ public Order quantity(Integer quantity) { this.quantity = quantity; return this; @@ -97,7 +107,7 @@ public class Order { } /** - **/ + */ public Order shipDate(Date shipDate) { this.shipDate = shipDate; return this; @@ -115,7 +125,7 @@ public class Order { /** * Order Status - **/ + */ public Order status(StatusEnum status) { this.status = status; return this; @@ -132,7 +142,7 @@ public class Order { } /** - **/ + */ public Order complete(Boolean complete) { this.complete = complete; return this; diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java index a80d291fc41..2837ebec20a 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java @@ -1,3 +1,13 @@ +/* + * 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 document version: 1.0.0 + * + * + * AUTO-GENERATED FILE, DO NOT MODIFY! + */ package org.openapitools.model; import java.util.Objects; @@ -15,7 +25,7 @@ import org.openapitools.model.Tag; /** * 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.JavaUndertowServerCodegen") @@ -49,7 +59,7 @@ public class Pet { private StatusEnum status; /** - **/ + */ public Pet id(Long id) { this.id = id; return this; @@ -66,7 +76,7 @@ public class Pet { } /** - **/ + */ public Pet category(Category category) { this.category = category; return this; @@ -83,7 +93,7 @@ public class Pet { } /** - **/ + */ public Pet name(String name) { this.name = name; return this; @@ -100,7 +110,7 @@ public class Pet { } /** - **/ + */ public Pet photoUrls(List