Skip to content

Commit 8c8be74

Browse files
authored
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
1 parent 7d86adc commit 8c8be74

8 files changed

Lines changed: 231 additions & 123 deletions

File tree

.github/workflows/samples-java-server-jdk8.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ on:
88
- 'samples/server/petstore/java-vertx-web/**'
99
- 'samples/server/petstore/java-inflector/**'
1010
- 'samples/server/petstore/java-pkmst/**'
11+
# test in circleci instead
1112
- 'samples/server/petstore/java-undertow/**'
1213
pull_request:
1314
paths:
1415
#- 'samples/server/petstore/java-camel/**'
1516
- 'samples/server/petstore/java-vertx-web/**'
1617
- 'samples/server/petstore/java-inflector/**'
1718
- 'samples/server/petstore/java-pkmst/**'
18-
- 'samples/server/petstore/java-undertow/**'
19+
#- 'samples/server/petstore/java-undertow/**'
1920
jobs:
2021
build:
2122
name: Build Java Server
@@ -29,7 +30,7 @@ jobs:
2930
- samples/server/petstore/java-vertx-web/
3031
- samples/server/petstore/java-inflector/
3132
- samples/server/petstore/java-pkmst/
32-
- samples/server/petstore/java-undertow/
33+
#- samples/server/petstore/java-undertow/
3334
steps:
3435
- uses: actions/checkout@v4
3536
- uses: actions/setup-java@v3
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
generatorName: java-undertow-server
22
outputDir: samples/server/petstore/java-undertow
3-
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
44
templateDir: modules/openapi-generator/src/main/resources/java-undertow-server
55
additionalProperties:
66
hideGenerationTimestamp: "true"

modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<version.logback>1.2.0</version.logback>
3030
<version.junit>4.13.2</version.junit>
3131
<version.mockito>2.1.0-beta.124</version.mockito>
32-
<version.undertow>2.2.24.Final</version.undertow>
32+
<version.undertow>2.3.5.Final</version.undertow>
3333
<version.jsonpath>2.2.0</version.jsonpath>
3434
<version.httpclient>4.5.13</version.httpclient>
3535
<version.httpasyncclient>4.1.2</version.httpasyncclient>

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,8 @@
12901290
<module>samples/client/petstore/java/resteasy</module>
12911291
<module>samples/client/petstore/java-micronaut-client</module>
12921292
<module>samples/client/petstore/java/apache-httpclient</module>
1293+
<!-- server -->
1294+
<module>samples/server/petstore/java-undertow</module>
12931295
</modules>
12941296
</profile>
12951297
<!-- test with Haskell -->

samples/server/petstore/java-undertow/dependency-reduced-pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
<version.framework>0.1.1</version.framework>
136136
<version.jackson>2.14.1</version.jackson>
137137
<version.httpasyncclient>4.1.2</version.httpasyncclient>
138-
<version.undertow>2.2.24.Final</version.undertow>
138+
<version.undertow>2.3.5.Final</version.undertow>
139139
<version.slf4j>1.7.21</version.slf4j>
140140
<version.jackson.databind>2.14.1</version.jackson.databind>
141141
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

samples/server/petstore/java-undertow/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<version.logback>1.2.0</version.logback>
3030
<version.junit>4.13.2</version.junit>
3131
<version.mockito>2.1.0-beta.124</version.mockito>
32-
<version.undertow>2.2.24.Final</version.undertow>
32+
<version.undertow>2.3.5.Final</version.undertow>
3333
<version.jsonpath>2.2.0</version.jsonpath>
3434
<version.httpclient>4.5.13</version.httpclient>
3535
<version.httpasyncclient>4.1.2</version.httpasyncclient>

samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public interface PathHandlerInterface {
2121
/**
2222
* <p>Add a new pet to the store</p>
2323
*
24+
* <p></p>
25+
*
2426
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/pet" (<i>privileged: true</i>)</p>
2527
*
2628
* <p><b>Request parameters</b>:</p>
@@ -30,9 +32,12 @@ public interface PathHandlerInterface {
3032
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}, {isXml=true, mediaType=application/xml}]</p>
3133
* <p><b>Payload</b>: {@link Pet} (<i>required: true</i>)</p>
3234
*
35+
* <p><b>Produces</b>: [{isXml=true, mediaType=application/xml}, {isJson=true, mediaType=application/json}]</p>
36+
* <p><b>Returns</b>: {@link Pet}</p>
3337
*
3438
* <p><b>Responses</b>:</p>
3539
* <ul>
40+
* <li><b>200 (success)</b>: successful operation</li>
3641
* <li><b>405 (client error)</b>: Invalid input</li>
3742
* </ul>
3843
*/
@@ -42,6 +47,8 @@ public interface PathHandlerInterface {
4247
/**
4348
* <p>Deletes a pet</p>
4449
*
50+
* <p></p>
51+
*
4552
* <p><b>Endpoint</b>: {@link Methods#DELETE DELETE} "/v2/pet/{petId}" (<i>privileged: true</i>)</p>
4653
*
4754
* <p><b>Request parameters</b>:</p>
@@ -175,6 +182,8 @@ public interface PathHandlerInterface {
175182
/**
176183
* <p>Update an existing pet</p>
177184
*
185+
* <p></p>
186+
*
178187
* <p><b>Endpoint</b>: {@link Methods#PUT PUT} "/v2/pet" (<i>privileged: true</i>)</p>
179188
*
180189
* <p><b>Request parameters</b>:</p>
@@ -184,9 +193,12 @@ public interface PathHandlerInterface {
184193
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}, {isXml=true, mediaType=application/xml}]</p>
185194
* <p><b>Payload</b>: {@link Pet} (<i>required: true</i>)</p>
186195
*
196+
* <p><b>Produces</b>: [{isXml=true, mediaType=application/xml}, {isJson=true, mediaType=application/json}]</p>
197+
* <p><b>Returns</b>: {@link Pet}</p>
187198
*
188199
* <p><b>Responses</b>:</p>
189200
* <ul>
201+
* <li><b>200 (success)</b>: successful operation</li>
190202
* <li><b>400 (client error)</b>: Invalid ID supplied</li>
191203
* <li><b>404 (client error)</b>: Pet not found</li>
192204
* <li><b>405 (client error)</b>: Validation exception</li>
@@ -198,6 +210,8 @@ public interface PathHandlerInterface {
198210
/**
199211
* <p>Updates a pet in the store with form data</p>
200212
*
213+
* <p></p>
214+
*
201215
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/pet/{petId}" (<i>privileged: true</i>)</p>
202216
*
203217
* <p><b>Request parameters</b>:</p>
@@ -245,6 +259,8 @@ public interface PathHandlerInterface {
245259
/**
246260
* <p>uploads an image</p>
247261
*
262+
* <p></p>
263+
*
248264
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/pet/{petId}/uploadImage" (<i>privileged: true</i>)</p>
249265
*
250266
* <p><b>Request parameters</b>:</p>
@@ -375,12 +391,17 @@ public interface PathHandlerInterface {
375391
/**
376392
* <p>Place an order for a pet</p>
377393
*
394+
* <p></p>
395+
*
378396
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/store/order" (<i>privileged: false</i>)</p>
379397
*
380398
* <p><b>Request parameters</b>:</p>
381399
* <ul>
382400
* </ul>
383401
*
402+
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}]</p>
403+
* <p><b>Payload</b>: {@link Order} (<i>required: true</i>)</p>
404+
*
384405
* <p><b>Produces</b>: [{isXml=true, mediaType=application/xml}, {isJson=true, mediaType=application/json}]</p>
385406
* <p><b>Returns</b>: {@link Order}</p>
386407
*
@@ -398,12 +419,15 @@ public interface PathHandlerInterface {
398419
*
399420
* <p>This can only be done by the logged in user.</p>
400421
*
401-
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user" (<i>privileged: false</i>)</p>
422+
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user" (<i>privileged: true</i>)</p>
402423
*
403424
* <p><b>Request parameters</b>:</p>
404425
* <ul>
405426
* </ul>
406427
*
428+
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}]</p>
429+
* <p><b>Payload</b>: {@link User} (<i>required: true</i>)</p>
430+
*
407431
*
408432
* <p><b>Responses</b>:</p>
409433
* <ul>
@@ -416,12 +440,17 @@ public interface PathHandlerInterface {
416440
/**
417441
* <p>Creates list of users with given input array</p>
418442
*
419-
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user/createWithArray" (<i>privileged: false</i>)</p>
443+
* <p></p>
444+
*
445+
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user/createWithArray" (<i>privileged: true</i>)</p>
420446
*
421447
* <p><b>Request parameters</b>:</p>
422448
* <ul>
423449
* </ul>
424450
*
451+
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}]</p>
452+
* <p><b>Payload</b>: {@link java.util.List List} of {@link User} (<i>required: true</i>)</p>
453+
*
425454
*
426455
* <p><b>Responses</b>:</p>
427456
* <ul>
@@ -434,12 +463,17 @@ public interface PathHandlerInterface {
434463
/**
435464
* <p>Creates list of users with given input array</p>
436465
*
437-
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user/createWithList" (<i>privileged: false</i>)</p>
466+
* <p></p>
467+
*
468+
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user/createWithList" (<i>privileged: true</i>)</p>
438469
*
439470
* <p><b>Request parameters</b>:</p>
440471
* <ul>
441472
* </ul>
442473
*
474+
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}]</p>
475+
* <p><b>Payload</b>: {@link java.util.List List} of {@link User} (<i>required: true</i>)</p>
476+
*
443477
*
444478
* <p><b>Responses</b>:</p>
445479
* <ul>
@@ -454,7 +488,7 @@ public interface PathHandlerInterface {
454488
*
455489
* <p>This can only be done by the logged in user.</p>
456490
*
457-
* <p><b>Endpoint</b>: {@link Methods#DELETE DELETE} "/v2/user/{username}" (<i>privileged: false</i>)</p>
491+
* <p><b>Endpoint</b>: {@link Methods#DELETE DELETE} "/v2/user/{username}" (<i>privileged: true</i>)</p>
458492
*
459493
* <p><b>Request parameters</b>:</p>
460494
* <ul>
@@ -482,6 +516,8 @@ public interface PathHandlerInterface {
482516
/**
483517
* <p>Get user by user name</p>
484518
*
519+
* <p></p>
520+
*
485521
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/{username}" (<i>privileged: false</i>)</p>
486522
*
487523
* <p><b>Request parameters</b>:</p>
@@ -513,6 +549,8 @@ public interface PathHandlerInterface {
513549
/**
514550
* <p>Logs user into the system</p>
515551
*
552+
* <p></p>
553+
*
516554
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/login" (<i>privileged: false</i>)</p>
517555
*
518556
* <p><b>Request parameters</b>:</p>
@@ -536,7 +574,10 @@ public interface PathHandlerInterface {
536574
* </p>
537575
* </li>
538576
* </ul>
539-
* <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='{
577+
* <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='{
578+
"type" : "string",
579+
"example" : "AUTH_KEY=abcde12345; Path=/; HttpOnly"
580+
}', 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='{
540581
"type" : "integer",
541582
"format" : "int32"
542583
}', 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 {
559600
/**
560601
* <p>Logs out current logged in user session</p>
561602
*
562-
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/logout" (<i>privileged: false</i>)</p>
603+
* <p></p>
604+
*
605+
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/logout" (<i>privileged: true</i>)</p>
563606
*
564607
*
565608
* <p><b>Responses</b>:</p>
@@ -575,7 +618,7 @@ public interface PathHandlerInterface {
575618
*
576619
* <p>This can only be done by the logged in user.</p>
577620
*
578-
* <p><b>Endpoint</b>: {@link Methods#PUT PUT} "/v2/user/{username}" (<i>privileged: false</i>)</p>
621+
* <p><b>Endpoint</b>: {@link Methods#PUT PUT} "/v2/user/{username}" (<i>privileged: true</i>)</p>
579622
*
580623
* <p><b>Request parameters</b>:</p>
581624
* <ul>
@@ -590,6 +633,9 @@ public interface PathHandlerInterface {
590633
* </li>
591634
* </ul>
592635
*
636+
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}]</p>
637+
* <p><b>Payload</b>: {@link User} (<i>required: true</i>)</p>
638+
*
593639
*
594640
* <p><b>Responses</b>:</p>
595641
* <ul>

0 commit comments

Comments
 (0)