Update java undertow to newer version (#16606)

* update java undertow to newer version

* update compiler plugin to newer version

* test undertow in circleci

* use 3.0 spec
This commit is contained in:
William Cheng 2023-09-18 11:26:33 +08:00 committed by GitHub
parent 7d86adccc4
commit 8c8be7482b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 233 additions and 125 deletions

View File

@ -8,6 +8,7 @@ on:
- 'samples/server/petstore/java-vertx-web/**' - 'samples/server/petstore/java-vertx-web/**'
- 'samples/server/petstore/java-inflector/**' - 'samples/server/petstore/java-inflector/**'
- 'samples/server/petstore/java-pkmst/**' - 'samples/server/petstore/java-pkmst/**'
# test in circleci instead
- 'samples/server/petstore/java-undertow/**' - 'samples/server/petstore/java-undertow/**'
pull_request: pull_request:
paths: paths:
@ -15,7 +16,7 @@ on:
- 'samples/server/petstore/java-vertx-web/**' - 'samples/server/petstore/java-vertx-web/**'
- 'samples/server/petstore/java-inflector/**' - 'samples/server/petstore/java-inflector/**'
- 'samples/server/petstore/java-pkmst/**' - 'samples/server/petstore/java-pkmst/**'
- 'samples/server/petstore/java-undertow/**' #- 'samples/server/petstore/java-undertow/**'
jobs: jobs:
build: build:
name: Build Java Server name: Build Java Server
@ -29,7 +30,7 @@ jobs:
- samples/server/petstore/java-vertx-web/ - samples/server/petstore/java-vertx-web/
- samples/server/petstore/java-inflector/ - samples/server/petstore/java-inflector/
- samples/server/petstore/java-pkmst/ - samples/server/petstore/java-pkmst/
- samples/server/petstore/java-undertow/ #- samples/server/petstore/java-undertow/
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-java@v3 - uses: actions/setup-java@v3

View File

@ -1,6 +1,6 @@
generatorName: java-undertow-server generatorName: java-undertow-server
outputDir: samples/server/petstore/java-undertow outputDir: samples/server/petstore/java-undertow
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/java-undertow-server templateDir: modules/openapi-generator/src/main/resources/java-undertow-server
additionalProperties: additionalProperties:
hideGenerationTimestamp: "true" hideGenerationTimestamp: "true"

View File

@ -29,7 +29,7 @@
<version.logback>1.2.0</version.logback> <version.logback>1.2.0</version.logback>
<version.junit>4.13.2</version.junit> <version.junit>4.13.2</version.junit>
<version.mockito>2.1.0-beta.124</version.mockito> <version.mockito>2.1.0-beta.124</version.mockito>
<version.undertow>2.2.24.Final</version.undertow> <version.undertow>2.3.5.Final</version.undertow>
<version.jsonpath>2.2.0</version.jsonpath> <version.jsonpath>2.2.0</version.jsonpath>
<version.httpclient>4.5.13</version.httpclient> <version.httpclient>4.5.13</version.httpclient>
<version.httpasyncclient>4.1.2</version.httpasyncclient> <version.httpasyncclient>4.1.2</version.httpasyncclient>

View File

@ -1290,6 +1290,8 @@
<module>samples/client/petstore/java/resteasy</module> <module>samples/client/petstore/java/resteasy</module>
<module>samples/client/petstore/java-micronaut-client</module> <module>samples/client/petstore/java-micronaut-client</module>
<module>samples/client/petstore/java/apache-httpclient</module> <module>samples/client/petstore/java/apache-httpclient</module>
<!-- server -->
<module>samples/server/petstore/java-undertow</module>
</modules> </modules>
</profile> </profile>
<!-- test with Haskell --> <!-- test with Haskell -->

View File

@ -135,7 +135,7 @@
<version.framework>0.1.1</version.framework> <version.framework>0.1.1</version.framework>
<version.jackson>2.14.1</version.jackson> <version.jackson>2.14.1</version.jackson>
<version.httpasyncclient>4.1.2</version.httpasyncclient> <version.httpasyncclient>4.1.2</version.httpasyncclient>
<version.undertow>2.2.24.Final</version.undertow> <version.undertow>2.3.5.Final</version.undertow>
<version.slf4j>1.7.21</version.slf4j> <version.slf4j>1.7.21</version.slf4j>
<version.jackson.databind>2.14.1</version.jackson.databind> <version.jackson.databind>2.14.1</version.jackson.databind>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@ -29,7 +29,7 @@
<version.logback>1.2.0</version.logback> <version.logback>1.2.0</version.logback>
<version.junit>4.13.2</version.junit> <version.junit>4.13.2</version.junit>
<version.mockito>2.1.0-beta.124</version.mockito> <version.mockito>2.1.0-beta.124</version.mockito>
<version.undertow>2.2.24.Final</version.undertow> <version.undertow>2.3.5.Final</version.undertow>
<version.jsonpath>2.2.0</version.jsonpath> <version.jsonpath>2.2.0</version.jsonpath>
<version.httpclient>4.5.13</version.httpclient> <version.httpclient>4.5.13</version.httpclient>
<version.httpasyncclient>4.1.2</version.httpasyncclient> <version.httpasyncclient>4.1.2</version.httpasyncclient>

View File

@ -21,6 +21,8 @@ public interface PathHandlerInterface {
/** /**
* <p>Add a new pet to the store</p> * <p>Add a new pet to the store</p>
* *
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/pet" (<i>privileged: true</i>)</p> * <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/pet" (<i>privileged: true</i>)</p>
* *
* <p><b>Request parameters</b>:</p> * <p><b>Request parameters</b>:</p>
@ -30,9 +32,12 @@ public interface PathHandlerInterface {
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}, {isXml=true, mediaType=application/xml}]</p> * <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}, {isXml=true, mediaType=application/xml}]</p>
* <p><b>Payload</b>: {@link Pet} (<i>required: true</i>)</p> * <p><b>Payload</b>: {@link Pet} (<i>required: true</i>)</p>
* *
* <p><b>Produces</b>: [{isXml=true, mediaType=application/xml}, {isJson=true, mediaType=application/json}]</p>
* <p><b>Returns</b>: {@link Pet}</p>
* *
* <p><b>Responses</b>:</p> * <p><b>Responses</b>:</p>
* <ul> * <ul>
* <li><b>200 (success)</b>: successful operation</li>
* <li><b>405 (client error)</b>: Invalid input</li> * <li><b>405 (client error)</b>: Invalid input</li>
* </ul> * </ul>
*/ */
@ -42,6 +47,8 @@ public interface PathHandlerInterface {
/** /**
* <p>Deletes a pet</p> * <p>Deletes a pet</p>
* *
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#DELETE DELETE} "/v2/pet/{petId}" (<i>privileged: true</i>)</p> * <p><b>Endpoint</b>: {@link Methods#DELETE DELETE} "/v2/pet/{petId}" (<i>privileged: true</i>)</p>
* *
* <p><b>Request parameters</b>:</p> * <p><b>Request parameters</b>:</p>
@ -175,6 +182,8 @@ public interface PathHandlerInterface {
/** /**
* <p>Update an existing pet</p> * <p>Update an existing pet</p>
* *
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#PUT PUT} "/v2/pet" (<i>privileged: true</i>)</p> * <p><b>Endpoint</b>: {@link Methods#PUT PUT} "/v2/pet" (<i>privileged: true</i>)</p>
* *
* <p><b>Request parameters</b>:</p> * <p><b>Request parameters</b>:</p>
@ -184,9 +193,12 @@ public interface PathHandlerInterface {
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}, {isXml=true, mediaType=application/xml}]</p> * <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}, {isXml=true, mediaType=application/xml}]</p>
* <p><b>Payload</b>: {@link Pet} (<i>required: true</i>)</p> * <p><b>Payload</b>: {@link Pet} (<i>required: true</i>)</p>
* *
* <p><b>Produces</b>: [{isXml=true, mediaType=application/xml}, {isJson=true, mediaType=application/json}]</p>
* <p><b>Returns</b>: {@link Pet}</p>
* *
* <p><b>Responses</b>:</p> * <p><b>Responses</b>:</p>
* <ul> * <ul>
* <li><b>200 (success)</b>: successful operation</li>
* <li><b>400 (client error)</b>: Invalid ID supplied</li> * <li><b>400 (client error)</b>: Invalid ID supplied</li>
* <li><b>404 (client error)</b>: Pet not found</li> * <li><b>404 (client error)</b>: Pet not found</li>
* <li><b>405 (client error)</b>: Validation exception</li> * <li><b>405 (client error)</b>: Validation exception</li>
@ -198,6 +210,8 @@ public interface PathHandlerInterface {
/** /**
* <p>Updates a pet in the store with form data</p> * <p>Updates a pet in the store with form data</p>
* *
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/pet/{petId}" (<i>privileged: true</i>)</p> * <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/pet/{petId}" (<i>privileged: true</i>)</p>
* *
* <p><b>Request parameters</b>:</p> * <p><b>Request parameters</b>:</p>
@ -245,6 +259,8 @@ public interface PathHandlerInterface {
/** /**
* <p>uploads an image</p> * <p>uploads an image</p>
* *
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/pet/{petId}/uploadImage" (<i>privileged: true</i>)</p> * <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/pet/{petId}/uploadImage" (<i>privileged: true</i>)</p>
* *
* <p><b>Request parameters</b>:</p> * <p><b>Request parameters</b>:</p>
@ -375,12 +391,17 @@ public interface PathHandlerInterface {
/** /**
* <p>Place an order for a pet</p> * <p>Place an order for a pet</p>
* *
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/store/order" (<i>privileged: false</i>)</p> * <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/store/order" (<i>privileged: false</i>)</p>
* *
* <p><b>Request parameters</b>:</p> * <p><b>Request parameters</b>:</p>
* <ul> * <ul>
* </ul> * </ul>
* *
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}]</p>
* <p><b>Payload</b>: {@link Order} (<i>required: true</i>)</p>
*
* <p><b>Produces</b>: [{isXml=true, mediaType=application/xml}, {isJson=true, mediaType=application/json}]</p> * <p><b>Produces</b>: [{isXml=true, mediaType=application/xml}, {isJson=true, mediaType=application/json}]</p>
* <p><b>Returns</b>: {@link Order}</p> * <p><b>Returns</b>: {@link Order}</p>
* *
@ -398,12 +419,15 @@ public interface PathHandlerInterface {
* *
* <p>This can only be done by the logged in user.</p> * <p>This can only be done by the logged in user.</p>
* *
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user" (<i>privileged: false</i>)</p> * <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user" (<i>privileged: true</i>)</p>
* *
* <p><b>Request parameters</b>:</p> * <p><b>Request parameters</b>:</p>
* <ul> * <ul>
* </ul> * </ul>
* *
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}]</p>
* <p><b>Payload</b>: {@link User} (<i>required: true</i>)</p>
*
* *
* <p><b>Responses</b>:</p> * <p><b>Responses</b>:</p>
* <ul> * <ul>
@ -416,12 +440,17 @@ public interface PathHandlerInterface {
/** /**
* <p>Creates list of users with given input array</p> * <p>Creates list of users with given input array</p>
* *
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user/createWithArray" (<i>privileged: false</i>)</p> * <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user/createWithArray" (<i>privileged: true</i>)</p>
* *
* <p><b>Request parameters</b>:</p> * <p><b>Request parameters</b>:</p>
* <ul> * <ul>
* </ul> * </ul>
* *
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}]</p>
* <p><b>Payload</b>: {@link java.util.List List} of {@link User} (<i>required: true</i>)</p>
*
* *
* <p><b>Responses</b>:</p> * <p><b>Responses</b>:</p>
* <ul> * <ul>
@ -434,12 +463,17 @@ public interface PathHandlerInterface {
/** /**
* <p>Creates list of users with given input array</p> * <p>Creates list of users with given input array</p>
* *
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user/createWithList" (<i>privileged: false</i>)</p> * <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user/createWithList" (<i>privileged: true</i>)</p>
* *
* <p><b>Request parameters</b>:</p> * <p><b>Request parameters</b>:</p>
* <ul> * <ul>
* </ul> * </ul>
* *
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}]</p>
* <p><b>Payload</b>: {@link java.util.List List} of {@link User} (<i>required: true</i>)</p>
*
* *
* <p><b>Responses</b>:</p> * <p><b>Responses</b>:</p>
* <ul> * <ul>
@ -454,7 +488,7 @@ public interface PathHandlerInterface {
* *
* <p>This can only be done by the logged in user.</p> * <p>This can only be done by the logged in user.</p>
* *
* <p><b>Endpoint</b>: {@link Methods#DELETE DELETE} "/v2/user/{username}" (<i>privileged: false</i>)</p> * <p><b>Endpoint</b>: {@link Methods#DELETE DELETE} "/v2/user/{username}" (<i>privileged: true</i>)</p>
* *
* <p><b>Request parameters</b>:</p> * <p><b>Request parameters</b>:</p>
* <ul> * <ul>
@ -482,6 +516,8 @@ public interface PathHandlerInterface {
/** /**
* <p>Get user by user name</p> * <p>Get user by user name</p>
* *
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/{username}" (<i>privileged: false</i>)</p> * <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/{username}" (<i>privileged: false</i>)</p>
* *
* <p><b>Request parameters</b>:</p> * <p><b>Request parameters</b>:</p>
@ -513,6 +549,8 @@ public interface PathHandlerInterface {
/** /**
* <p>Logs user into the system</p> * <p>Logs user into the system</p>
* *
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/login" (<i>privileged: false</i>)</p> * <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/login" (<i>privileged: false</i>)</p>
* *
* <p><b>Request parameters</b>:</p> * <p><b>Request parameters</b>:</p>
@ -536,7 +574,10 @@ public interface PathHandlerInterface {
* </p> * </p>
* </li> * </li>
* </ul> * </ul>
* <p><b>Response headers</b>: [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', containerTypeMapped='null', title='null', unescapedDescription='calls per hour allowed by the user', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{ * <p><b>Response headers</b>: [CodegenProperty{openApiType='string', baseName='Set-Cookie', complexType='null', getter='getSetCookie', setter='setSetCookie', description='Cookie authentication key for use with the `api_key` apiKey authentication.', dataType='String', datatypeWithEnum='String', dataFormat='null', name='setCookie', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.Set-Cookie;', baseType='String', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='Cookie authentication key for use with the `api_key` apiKey authentication.', maxLength=null, minLength=null, pattern='null', example='AUTH_KEY=abcde12345; Path=/; HttpOnly', jsonSchema='{
"type" : "string",
"example" : "AUTH_KEY=abcde12345; Path=/; HttpOnly"
}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=true, isNumeric=false, isInteger=false, isShort=false, isLong=false, isUnboundedInteger=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, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='SetCookie', nameInSnakeCase='SET_COOKIE', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null}, 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', containerTypeMapped='null', title='null', unescapedDescription='calls per hour allowed by the user', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{
"type" : "integer", "type" : "integer",
"format" : "int32" "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, isShort=true, isLong=false, isUnboundedInteger=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, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _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, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=int32, dependentRequired=null, contains=null}, CodegenProperty{openApiType='string', baseName='X-Expires-After', complexType='Date', getter='getxExpiresAfter', setter='setxExpiresAfter', description='date in UTC when token 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', containerTypeMapped='null', title='null', unescapedDescription='date in UTC when token expires', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{ }', 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, isShort=true, isLong=false, isUnboundedInteger=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, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _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, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=int32, dependentRequired=null, contains=null}, CodegenProperty{openApiType='string', baseName='X-Expires-After', complexType='Date', getter='getxExpiresAfter', setter='setxExpiresAfter', description='date in UTC when token 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', containerTypeMapped='null', title='null', unescapedDescription='date in UTC when token expires', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{
@ -559,7 +600,9 @@ public interface PathHandlerInterface {
/** /**
* <p>Logs out current logged in user session</p> * <p>Logs out current logged in user session</p>
* *
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/logout" (<i>privileged: false</i>)</p> * <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/logout" (<i>privileged: true</i>)</p>
* *
* *
* <p><b>Responses</b>:</p> * <p><b>Responses</b>:</p>
@ -575,7 +618,7 @@ public interface PathHandlerInterface {
* *
* <p>This can only be done by the logged in user.</p> * <p>This can only be done by the logged in user.</p>
* *
* <p><b>Endpoint</b>: {@link Methods#PUT PUT} "/v2/user/{username}" (<i>privileged: false</i>)</p> * <p><b>Endpoint</b>: {@link Methods#PUT PUT} "/v2/user/{username}" (<i>privileged: true</i>)</p>
* *
* <p><b>Request parameters</b>:</p> * <p><b>Request parameters</b>:</p>
* <ul> * <ul>
@ -590,6 +633,9 @@ public interface PathHandlerInterface {
* </li> * </li>
* </ul> * </ul>
* *
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}]</p>
* <p><b>Payload</b>: {@link User} (<i>required: true</i>)</p>
*
* *
* <p><b>Responses</b>:</p> * <p><b>Responses</b>:</p>
* <ul> * <ul>

View File

@ -1,5 +1,5 @@
{ {
"openapi" : "3.0.1", "openapi" : "3.0.0",
"info" : { "info" : {
"description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.",
"license" : { "license" : {
@ -9,6 +9,10 @@
"title" : "OpenAPI Petstore", "title" : "OpenAPI Petstore",
"version" : "1.0.0" "version" : "1.0.0"
}, },
"externalDocs" : {
"description" : "Find out more about Swagger",
"url" : "http://swagger.io"
},
"servers" : [ { "servers" : [ {
"url" : "http://petstore.swagger.io/v2" "url" : "http://petstore.swagger.io/v2"
} ], } ],
@ -25,26 +29,28 @@
"paths" : { "paths" : {
"/pet" : { "/pet" : {
"post" : { "post" : {
"description" : "",
"operationId" : "addPet", "operationId" : "addPet",
"requestBody" : { "requestBody" : {
"content" : { "$ref" : "#/components/requestBodies/Pet"
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
},
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
}
},
"description" : "Pet object that needs to be added to the store",
"required" : true
}, },
"responses" : { "responses" : {
"200" : {
"content" : {
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
},
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
}
},
"description" : "successful operation"
},
"405" : { "405" : {
"content" : { },
"description" : "Invalid input" "description" : "Invalid input"
} }
}, },
@ -53,39 +59,42 @@
} ], } ],
"summary" : "Add a new pet to the store", "summary" : "Add a new pet to the store",
"tags" : [ "pet" ], "tags" : [ "pet" ],
"x-codegen-request-body-name" : "body",
"x-content-type" : "application/json", "x-content-type" : "application/json",
"x-accepts" : "application/json" "x-accepts" : "application/json"
}, },
"put" : { "put" : {
"description" : "",
"externalDocs" : {
"description" : "API documentation for the updatePet operation",
"url" : "http://petstore.swagger.io/v2/doc/updatePet"
},
"operationId" : "updatePet", "operationId" : "updatePet",
"requestBody" : { "requestBody" : {
"content" : { "$ref" : "#/components/requestBodies/Pet"
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
},
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
}
},
"description" : "Pet object that needs to be added to the store",
"required" : true
}, },
"responses" : { "responses" : {
"200" : {
"content" : {
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
},
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
}
},
"description" : "successful operation"
},
"400" : { "400" : {
"content" : { },
"description" : "Invalid ID supplied" "description" : "Invalid ID supplied"
}, },
"404" : { "404" : {
"content" : { },
"description" : "Pet not found" "description" : "Pet not found"
}, },
"405" : { "405" : {
"content" : { },
"description" : "Validation exception" "description" : "Validation exception"
} }
}, },
@ -94,7 +103,6 @@
} ], } ],
"summary" : "Update an existing pet", "summary" : "Update an existing pet",
"tags" : [ "pet" ], "tags" : [ "pet" ],
"x-codegen-request-body-name" : "body",
"x-content-type" : "application/json", "x-content-type" : "application/json",
"x-accepts" : "application/json" "x-accepts" : "application/json"
} }
@ -104,6 +112,7 @@
"description" : "Multiple status values can be provided with comma separated strings", "description" : "Multiple status values can be provided with comma separated strings",
"operationId" : "findPetsByStatus", "operationId" : "findPetsByStatus",
"parameters" : [ { "parameters" : [ {
"deprecated" : true,
"description" : "Status values that need to be considered for filter", "description" : "Status values that need to be considered for filter",
"explode" : false, "explode" : false,
"in" : "query", "in" : "query",
@ -142,12 +151,11 @@
"description" : "successful operation" "description" : "successful operation"
}, },
"400" : { "400" : {
"content" : { },
"description" : "Invalid status value" "description" : "Invalid status value"
} }
}, },
"security" : [ { "security" : [ {
"petstore_auth" : [ "write:pets", "read:pets" ] "petstore_auth" : [ "read:pets" ]
} ], } ],
"summary" : "Finds Pets by status", "summary" : "Finds Pets by status",
"tags" : [ "pet" ], "tags" : [ "pet" ],
@ -196,12 +204,11 @@
"description" : "successful operation" "description" : "successful operation"
}, },
"400" : { "400" : {
"content" : { },
"description" : "Invalid tag value" "description" : "Invalid tag value"
} }
}, },
"security" : [ { "security" : [ {
"petstore_auth" : [ "write:pets", "read:pets" ] "petstore_auth" : [ "read:pets" ]
} ], } ],
"summary" : "Finds Pets by tags", "summary" : "Finds Pets by tags",
"tags" : [ "pet" ], "tags" : [ "pet" ],
@ -210,26 +217,31 @@
}, },
"/pet/{petId}" : { "/pet/{petId}" : {
"delete" : { "delete" : {
"description" : "",
"operationId" : "deletePet", "operationId" : "deletePet",
"parameters" : [ { "parameters" : [ {
"explode" : false,
"in" : "header", "in" : "header",
"name" : "api_key", "name" : "api_key",
"required" : false,
"schema" : { "schema" : {
"type" : "string" "type" : "string"
} },
"style" : "simple"
}, { }, {
"description" : "Pet id to delete", "description" : "Pet id to delete",
"explode" : false,
"in" : "path", "in" : "path",
"name" : "petId", "name" : "petId",
"required" : true, "required" : true,
"schema" : { "schema" : {
"format" : "int64", "format" : "int64",
"type" : "integer" "type" : "integer"
} },
"style" : "simple"
} ], } ],
"responses" : { "responses" : {
"400" : { "400" : {
"content" : { },
"description" : "Invalid pet value" "description" : "Invalid pet value"
} }
}, },
@ -245,13 +257,15 @@
"operationId" : "getPetById", "operationId" : "getPetById",
"parameters" : [ { "parameters" : [ {
"description" : "ID of pet to return", "description" : "ID of pet to return",
"explode" : false,
"in" : "path", "in" : "path",
"name" : "petId", "name" : "petId",
"required" : true, "required" : true,
"schema" : { "schema" : {
"format" : "int64", "format" : "int64",
"type" : "integer" "type" : "integer"
} },
"style" : "simple"
} ], } ],
"responses" : { "responses" : {
"200" : { "200" : {
@ -270,11 +284,9 @@
"description" : "successful operation" "description" : "successful operation"
}, },
"400" : { "400" : {
"content" : { },
"description" : "Invalid ID supplied" "description" : "Invalid ID supplied"
}, },
"404" : { "404" : {
"content" : { },
"description" : "Pet not found" "description" : "Pet not found"
} }
}, },
@ -286,16 +298,19 @@
"x-accepts" : "application/json" "x-accepts" : "application/json"
}, },
"post" : { "post" : {
"description" : "",
"operationId" : "updatePetWithForm", "operationId" : "updatePetWithForm",
"parameters" : [ { "parameters" : [ {
"description" : "ID of pet that needs to be updated", "description" : "ID of pet that needs to be updated",
"explode" : false,
"in" : "path", "in" : "path",
"name" : "petId", "name" : "petId",
"required" : true, "required" : true,
"schema" : { "schema" : {
"format" : "int64", "format" : "int64",
"type" : "integer" "type" : "integer"
} },
"style" : "simple"
} ], } ],
"requestBody" : { "requestBody" : {
"content" : { "content" : {
@ -308,7 +323,6 @@
}, },
"responses" : { "responses" : {
"405" : { "405" : {
"content" : { },
"description" : "Invalid input" "description" : "Invalid input"
} }
}, },
@ -323,16 +337,19 @@
}, },
"/pet/{petId}/uploadImage" : { "/pet/{petId}/uploadImage" : {
"post" : { "post" : {
"description" : "",
"operationId" : "uploadFile", "operationId" : "uploadFile",
"parameters" : [ { "parameters" : [ {
"description" : "ID of pet to update", "description" : "ID of pet to update",
"explode" : false,
"in" : "path", "in" : "path",
"name" : "petId", "name" : "petId",
"required" : true, "required" : true,
"schema" : { "schema" : {
"format" : "int64", "format" : "int64",
"type" : "integer" "type" : "integer"
} },
"style" : "simple"
} ], } ],
"requestBody" : { "requestBody" : {
"content" : { "content" : {
@ -394,10 +411,11 @@
}, },
"/store/order" : { "/store/order" : {
"post" : { "post" : {
"description" : "",
"operationId" : "placeOrder", "operationId" : "placeOrder",
"requestBody" : { "requestBody" : {
"content" : { "content" : {
"*/*" : { "application/json" : {
"schema" : { "schema" : {
"$ref" : "#/components/schemas/Order" "$ref" : "#/components/schemas/Order"
} }
@ -423,14 +441,12 @@
"description" : "successful operation" "description" : "successful operation"
}, },
"400" : { "400" : {
"content" : { },
"description" : "Invalid Order" "description" : "Invalid Order"
} }
}, },
"summary" : "Place an order for a pet", "summary" : "Place an order for a pet",
"tags" : [ "store" ], "tags" : [ "store" ],
"x-codegen-request-body-name" : "body", "x-content-type" : "application/json",
"x-content-type" : "*/*",
"x-accepts" : "application/json" "x-accepts" : "application/json"
} }
}, },
@ -440,20 +456,20 @@
"operationId" : "deleteOrder", "operationId" : "deleteOrder",
"parameters" : [ { "parameters" : [ {
"description" : "ID of the order that needs to be deleted", "description" : "ID of the order that needs to be deleted",
"explode" : false,
"in" : "path", "in" : "path",
"name" : "orderId", "name" : "orderId",
"required" : true, "required" : true,
"schema" : { "schema" : {
"type" : "string" "type" : "string"
} },
"style" : "simple"
} ], } ],
"responses" : { "responses" : {
"400" : { "400" : {
"content" : { },
"description" : "Invalid ID supplied" "description" : "Invalid ID supplied"
}, },
"404" : { "404" : {
"content" : { },
"description" : "Order not found" "description" : "Order not found"
} }
}, },
@ -466,6 +482,7 @@
"operationId" : "getOrderById", "operationId" : "getOrderById",
"parameters" : [ { "parameters" : [ {
"description" : "ID of pet that needs to be fetched", "description" : "ID of pet that needs to be fetched",
"explode" : false,
"in" : "path", "in" : "path",
"name" : "orderId", "name" : "orderId",
"required" : true, "required" : true,
@ -474,7 +491,8 @@
"maximum" : 5, "maximum" : 5,
"minimum" : 1, "minimum" : 1,
"type" : "integer" "type" : "integer"
} },
"style" : "simple"
} ], } ],
"responses" : { "responses" : {
"200" : { "200" : {
@ -493,11 +511,9 @@
"description" : "successful operation" "description" : "successful operation"
}, },
"400" : { "400" : {
"content" : { },
"description" : "Invalid ID supplied" "description" : "Invalid ID supplied"
}, },
"404" : { "404" : {
"content" : { },
"description" : "Order not found" "description" : "Order not found"
} }
}, },
@ -512,7 +528,7 @@
"operationId" : "createUser", "operationId" : "createUser",
"requestBody" : { "requestBody" : {
"content" : { "content" : {
"*/*" : { "application/json" : {
"schema" : { "schema" : {
"$ref" : "#/components/schemas/User" "$ref" : "#/components/schemas/User"
} }
@ -523,96 +539,85 @@
}, },
"responses" : { "responses" : {
"default" : { "default" : {
"content" : { },
"description" : "successful operation" "description" : "successful operation"
} }
}, },
"security" : [ {
"api_key" : [ ]
} ],
"summary" : "Create user", "summary" : "Create user",
"tags" : [ "user" ], "tags" : [ "user" ],
"x-codegen-request-body-name" : "body", "x-content-type" : "application/json",
"x-content-type" : "*/*",
"x-accepts" : "application/json" "x-accepts" : "application/json"
} }
}, },
"/user/createWithArray" : { "/user/createWithArray" : {
"post" : { "post" : {
"description" : "",
"operationId" : "createUsersWithArrayInput", "operationId" : "createUsersWithArrayInput",
"requestBody" : { "requestBody" : {
"content" : { "$ref" : "#/components/requestBodies/UserArray"
"*/*" : {
"schema" : {
"items" : {
"$ref" : "#/components/schemas/User"
},
"type" : "array"
}
}
},
"description" : "List of user object",
"required" : true
}, },
"responses" : { "responses" : {
"default" : { "default" : {
"content" : { },
"description" : "successful operation" "description" : "successful operation"
} }
}, },
"security" : [ {
"api_key" : [ ]
} ],
"summary" : "Creates list of users with given input array", "summary" : "Creates list of users with given input array",
"tags" : [ "user" ], "tags" : [ "user" ],
"x-codegen-request-body-name" : "body", "x-content-type" : "application/json",
"x-content-type" : "*/*",
"x-accepts" : "application/json" "x-accepts" : "application/json"
} }
}, },
"/user/createWithList" : { "/user/createWithList" : {
"post" : { "post" : {
"description" : "",
"operationId" : "createUsersWithListInput", "operationId" : "createUsersWithListInput",
"requestBody" : { "requestBody" : {
"content" : { "$ref" : "#/components/requestBodies/UserArray"
"*/*" : {
"schema" : {
"items" : {
"$ref" : "#/components/schemas/User"
},
"type" : "array"
}
}
},
"description" : "List of user object",
"required" : true
}, },
"responses" : { "responses" : {
"default" : { "default" : {
"content" : { },
"description" : "successful operation" "description" : "successful operation"
} }
}, },
"security" : [ {
"api_key" : [ ]
} ],
"summary" : "Creates list of users with given input array", "summary" : "Creates list of users with given input array",
"tags" : [ "user" ], "tags" : [ "user" ],
"x-codegen-request-body-name" : "body", "x-content-type" : "application/json",
"x-content-type" : "*/*",
"x-accepts" : "application/json" "x-accepts" : "application/json"
} }
}, },
"/user/login" : { "/user/login" : {
"get" : { "get" : {
"description" : "",
"operationId" : "loginUser", "operationId" : "loginUser",
"parameters" : [ { "parameters" : [ {
"description" : "The user name for login", "description" : "The user name for login",
"explode" : true,
"in" : "query", "in" : "query",
"name" : "username", "name" : "username",
"required" : true, "required" : true,
"schema" : { "schema" : {
"pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$",
"type" : "string" "type" : "string"
} },
"style" : "form"
}, { }, {
"description" : "The password for login in clear text", "description" : "The password for login in clear text",
"explode" : true,
"in" : "query", "in" : "query",
"name" : "password", "name" : "password",
"required" : true, "required" : true,
"schema" : { "schema" : {
"type" : "string" "type" : "string"
} },
"style" : "form"
} ], } ],
"responses" : { "responses" : {
"200" : { "200" : {
@ -630,24 +635,36 @@
}, },
"description" : "successful operation", "description" : "successful operation",
"headers" : { "headers" : {
"Set-Cookie" : {
"description" : "Cookie authentication key for use with the `api_key` apiKey authentication.",
"explode" : false,
"schema" : {
"example" : "AUTH_KEY=abcde12345; Path=/; HttpOnly",
"type" : "string"
},
"style" : "simple"
},
"X-Rate-Limit" : { "X-Rate-Limit" : {
"description" : "calls per hour allowed by the user", "description" : "calls per hour allowed by the user",
"explode" : false,
"schema" : { "schema" : {
"format" : "int32", "format" : "int32",
"type" : "integer" "type" : "integer"
} },
"style" : "simple"
}, },
"X-Expires-After" : { "X-Expires-After" : {
"description" : "date in UTC when token expires", "description" : "date in UTC when token expires",
"explode" : false,
"schema" : { "schema" : {
"format" : "date-time", "format" : "date-time",
"type" : "string" "type" : "string"
} },
"style" : "simple"
} }
} }
}, },
"400" : { "400" : {
"content" : { },
"description" : "Invalid username/password supplied" "description" : "Invalid username/password supplied"
} }
}, },
@ -658,13 +675,16 @@
}, },
"/user/logout" : { "/user/logout" : {
"get" : { "get" : {
"description" : "",
"operationId" : "logoutUser", "operationId" : "logoutUser",
"responses" : { "responses" : {
"default" : { "default" : {
"content" : { },
"description" : "successful operation" "description" : "successful operation"
} }
}, },
"security" : [ {
"api_key" : [ ]
} ],
"summary" : "Logs out current logged in user session", "summary" : "Logs out current logged in user session",
"tags" : [ "user" ], "tags" : [ "user" ],
"x-accepts" : "application/json" "x-accepts" : "application/json"
@ -676,37 +696,43 @@
"operationId" : "deleteUser", "operationId" : "deleteUser",
"parameters" : [ { "parameters" : [ {
"description" : "The name that needs to be deleted", "description" : "The name that needs to be deleted",
"explode" : false,
"in" : "path", "in" : "path",
"name" : "username", "name" : "username",
"required" : true, "required" : true,
"schema" : { "schema" : {
"type" : "string" "type" : "string"
} },
"style" : "simple"
} ], } ],
"responses" : { "responses" : {
"400" : { "400" : {
"content" : { },
"description" : "Invalid username supplied" "description" : "Invalid username supplied"
}, },
"404" : { "404" : {
"content" : { },
"description" : "User not found" "description" : "User not found"
} }
}, },
"security" : [ {
"api_key" : [ ]
} ],
"summary" : "Delete user", "summary" : "Delete user",
"tags" : [ "user" ], "tags" : [ "user" ],
"x-accepts" : "application/json" "x-accepts" : "application/json"
}, },
"get" : { "get" : {
"description" : "",
"operationId" : "getUserByName", "operationId" : "getUserByName",
"parameters" : [ { "parameters" : [ {
"description" : "The name that needs to be fetched. Use user1 for testing.", "description" : "The name that needs to be fetched. Use user1 for testing.",
"explode" : false,
"in" : "path", "in" : "path",
"name" : "username", "name" : "username",
"required" : true, "required" : true,
"schema" : { "schema" : {
"type" : "string" "type" : "string"
} },
"style" : "simple"
} ], } ],
"responses" : { "responses" : {
"200" : { "200" : {
@ -725,11 +751,9 @@
"description" : "successful operation" "description" : "successful operation"
}, },
"400" : { "400" : {
"content" : { },
"description" : "Invalid username supplied" "description" : "Invalid username supplied"
}, },
"404" : { "404" : {
"content" : { },
"description" : "User not found" "description" : "User not found"
} }
}, },
@ -742,16 +766,18 @@
"operationId" : "updateUser", "operationId" : "updateUser",
"parameters" : [ { "parameters" : [ {
"description" : "name that need to be deleted", "description" : "name that need to be deleted",
"explode" : false,
"in" : "path", "in" : "path",
"name" : "username", "name" : "username",
"required" : true, "required" : true,
"schema" : { "schema" : {
"type" : "string" "type" : "string"
} },
"style" : "simple"
} ], } ],
"requestBody" : { "requestBody" : {
"content" : { "content" : {
"*/*" : { "application/json" : {
"schema" : { "schema" : {
"$ref" : "#/components/schemas/User" "$ref" : "#/components/schemas/User"
} }
@ -762,23 +788,55 @@
}, },
"responses" : { "responses" : {
"400" : { "400" : {
"content" : { },
"description" : "Invalid user supplied" "description" : "Invalid user supplied"
}, },
"404" : { "404" : {
"content" : { },
"description" : "User not found" "description" : "User not found"
} }
}, },
"security" : [ {
"api_key" : [ ]
} ],
"summary" : "Updated user", "summary" : "Updated user",
"tags" : [ "user" ], "tags" : [ "user" ],
"x-codegen-request-body-name" : "body", "x-content-type" : "application/json",
"x-content-type" : "*/*",
"x-accepts" : "application/json" "x-accepts" : "application/json"
} }
} }
}, },
"components" : { "components" : {
"requestBodies" : {
"UserArray" : {
"content" : {
"application/json" : {
"schema" : {
"items" : {
"$ref" : "#/components/schemas/User"
},
"type" : "array"
}
}
},
"description" : "List of user object",
"required" : true
},
"Pet" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
},
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
}
},
"description" : "Pet object that needs to be added to the store",
"required" : true
}
},
"schemas" : { "schemas" : {
"Order" : { "Order" : {
"description" : "An order for a pets from the pet store", "description" : "An order for a pets from the pet store",
@ -835,6 +893,7 @@
"type" : "integer" "type" : "integer"
}, },
"name" : { "name" : {
"pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$",
"type" : "string" "type" : "string"
} }
}, },
@ -964,6 +1023,7 @@
} }
}, },
"status" : { "status" : {
"deprecated" : true,
"description" : "pet status in the store", "description" : "pet status in the store",
"enum" : [ "available", "pending", "sold" ], "enum" : [ "available", "pending", "sold" ],
"type" : "string" "type" : "string"
@ -1045,6 +1105,5 @@
"type" : "apiKey" "type" : "apiKey"
} }
} }
}, }
"x-original-swagger-version" : "2.0"
} }