Skip to content

Commit 0be4068

Browse files
Merge branch 'quarkiverse:main' into main
2 parents 20bd8c4 + 0f08eca commit 0be4068

File tree

11 files changed

+422
-3
lines changed

11 files changed

+422
-3
lines changed

.github/workflows/build_website.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
4545
- name: Publishing directory for PR preview
4646
if: github.event_name == 'pull_request'
47-
uses: actions/upload-artifact@v4
47+
uses: actions/upload-artifact@v5
4848
with:
4949
name: site
5050
path: ./docs/target/generated-docs

client/deployment/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<name>Quarkus - OpenAPI Generator - Client - Deployment</name>
1212

1313
<properties>
14-
<version.org.openapitools>7.16.0</version.org.openapitools>
14+
<version.org.openapitools>7.17.0</version.org.openapitools>
1515
<version.org.slf4j>2.0.17</version.org.slf4j>
1616
<version.com.github.jknack>4.3.1</version.com.github.jknack>
1717
</properties>

client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/wrapper/QuarkusJavaClientCodegen.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ public void postProcess() {
143143

144144
}
145145

146+
@Override
147+
public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {
148+
super.postProcessModelProperty(model, property);
149+
if ("set".equals(property.containerType)) {
150+
model.imports.add("Arrays");
151+
}
152+
}
153+
146154
@Override
147155
public CodegenModel fromModel(String name, Schema model) {
148156
CodegenModel codegenModel = super.fromModel(name, model);

client/deployment/src/main/resources/templates/libraries/microprofile/pojo.qute

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public class {m.classname} {#if m.parent}extends {m.parent}{/if}{#if serializabl
8585
/**
8686
* Set {v.name}
8787
**/
88+
@JsonProperty("{v.baseName}")
8889
public void {v.setter}({v.datatypeWithEnum} {v.name}) {
8990
this.{v.name} = {v.name};
9091
}

client/deployment/src/main/resources/templates/libraries/microprofile/pojoQueryParam.qute

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
/**
7575
* Set {v.name}
7676
**/
77+
@com.fasterxml.jackson.annotation.JsonProperty("{v.baseName}")
7778
public void {v.setter}({v.datatypeWithEnum} {v.name}) {
7879
this.{v.name} = {v.name};
7980
}

client/integration-tests/array-enum/src/main/openapi/array-enum.yaml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ paths:
1717
required: true
1818
schema:
1919
$ref: '#/components/schemas/webhook_create_update_payload'
20+
- name: data-set
21+
in: query
22+
required: false
23+
schema:
24+
$ref: '#/components/schemas/webhook_create_update_set_payload'
2025
responses:
2126
"200":
2227
description: OK
@@ -47,13 +52,47 @@ components:
4752
- message_created
4853
- message_updated
4954
- webwidget_triggered
55+
default:
56+
- conversation_created
57+
description: The events you want to subscribe to.
58+
message:
59+
type: array
60+
items:
61+
type: string
62+
description: Non required Field to safe messages
63+
messageMap:
64+
type: object
65+
additionalProperties: true
66+
description: Non required Map Field to safe messages
67+
webhook_create_update_set_payload:
68+
required: [url, subscriptions]
69+
type: object
70+
properties:
71+
url:
72+
type: string
73+
description: The url where the events should be sent
74+
subscriptions:
75+
type: array
76+
uniqueItems: true
77+
items:
78+
type: string
79+
enum:
80+
- conversation_created
81+
- conversation_status_changed
82+
- conversation_updated
83+
- message_created
84+
- message_updated
85+
- webwidget_triggered
86+
default:
87+
- conversation_created
5088
description: The events you want to subscribe to.
5189
message:
5290
type: array
91+
uniqueItems: true
5392
items:
5493
type: string
5594
description: Non required Field to safe messages
5695
messageMap:
5796
type: object
5897
additionalProperties: true
59-
description: Non required Map Field to safe messages
98+
description: Non required Map Field to safe messages
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<parent>
4+
<artifactId>quarkus-openapi-generator-integration-tests</artifactId>
5+
<groupId>io.quarkiverse.openapi.generator</groupId>
6+
<version>3.0.0-SNAPSHOT</version>
7+
</parent>
8+
<modelVersion>4.0.0</modelVersion>
9+
10+
<artifactId>quarkus-openapi-generator-it-jsonproperty-getter-and-setter</artifactId>
11+
<name>Quarkus - OpenAPI Generator - Integration Tests - Client - @JsonProperty for getters and setters</name>
12+
<description>Ensures that @JsonProperty is properly added to getters and setters</description>
13+
14+
<dependencies>
15+
<dependency>
16+
<groupId>io.quarkiverse.openapi.generator</groupId>
17+
<artifactId>quarkus-openapi-generator</artifactId>
18+
</dependency>
19+
<dependency>
20+
<groupId>org.assertj</groupId>
21+
<artifactId>assertj-core</artifactId>
22+
<scope>test</scope>
23+
</dependency>
24+
<dependency>
25+
<groupId>io.quarkus</groupId>
26+
<artifactId>quarkus-junit5</artifactId>
27+
<scope>test</scope>
28+
</dependency>
29+
</dependencies>
30+
<build>
31+
<plugins>
32+
<plugin>
33+
<groupId>io.quarkus</groupId>
34+
<artifactId>quarkus-maven-plugin</artifactId>
35+
<extensions>true</extensions>
36+
<executions>
37+
<execution>
38+
<goals>
39+
<goal>build</goal>
40+
<goal>generate-code</goal>
41+
<goal>generate-code-tests</goal>
42+
</goals>
43+
</execution>
44+
</executions>
45+
</plugin>
46+
</plugins>
47+
</build>
48+
<profiles>
49+
<profile>
50+
<id>native-image</id>
51+
<activation>
52+
<property>
53+
<name>native</name>
54+
</property>
55+
</activation>
56+
<build>
57+
<plugins>
58+
<plugin>
59+
<artifactId>maven-surefire-plugin</artifactId>
60+
<configuration>
61+
<skipTests>${native.surefire.skip}</skipTests>
62+
</configuration>
63+
</plugin>
64+
<plugin>
65+
<artifactId>maven-failsafe-plugin</artifactId>
66+
<executions>
67+
<execution>
68+
<goals>
69+
<goal>integration-test</goal>
70+
<goal>verify</goal>
71+
</goals>
72+
<configuration>
73+
<systemPropertyVariables>
74+
<native.image.path>
75+
${project.build.directory}/${project.build.finalName}-runner
76+
</native.image.path>
77+
<java.util.logging.manager>org.jboss.logmanager.LogManager
78+
</java.util.logging.manager>
79+
<maven.home>${maven.home}</maven.home>
80+
</systemPropertyVariables>
81+
</configuration>
82+
</execution>
83+
</executions>
84+
</plugin>
85+
</plugins>
86+
</build>
87+
<properties>
88+
<quarkus.package.type>native</quarkus.package.type>
89+
</properties>
90+
</profile>
91+
</profiles>
92+
93+
</project>
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
{
2+
"openapi": "3.0.2",
3+
"info": {
4+
"title": "Animals - OpenAPI 3.0",
5+
"version": "1.0.5"
6+
},
7+
"servers": [
8+
{
9+
"url": "/api/v3"
10+
}
11+
],
12+
"tags": [
13+
{
14+
"name": "primate",
15+
"description": "Everything about Primates"
16+
}
17+
],
18+
"paths": {
19+
"/primate/{id}": {
20+
"get": {
21+
"tags": [
22+
"primate"
23+
],
24+
"summary": "Find primate by ID",
25+
"description": "Returns a single primate",
26+
"operationId": "getPrimateById",
27+
"parameters": [
28+
{
29+
"name": "id",
30+
"in": "path",
31+
"description": "ID of primate to return",
32+
"required": true,
33+
"schema": {
34+
"type": "integer",
35+
"format": "int64"
36+
}
37+
}
38+
],
39+
"responses": {
40+
"200": {
41+
"description": "successful operation",
42+
"content": {
43+
"application/json": {
44+
"schema": {
45+
"$ref": "#/components/schemas/Primate"
46+
}
47+
}
48+
}
49+
},
50+
"400": {
51+
"description": "Invalid ID supplied"
52+
},
53+
"404": {
54+
"description": "Primate not found"
55+
}
56+
}
57+
}
58+
}
59+
},
60+
"components": {
61+
"schemas": {
62+
"Animal": {
63+
"type": "object",
64+
"properties": {
65+
"born": {
66+
"type": "string",
67+
"description": "Dated Base extension.",
68+
"format": "date-time"
69+
},
70+
"deceased": {
71+
"type": "string",
72+
"description": "Dated Base extension.",
73+
"format": "date-time"
74+
},
75+
"animal_name": {
76+
"type": "string",
77+
"description": "Animal name"
78+
}
79+
},
80+
"xml": {
81+
"name": "animal"
82+
}
83+
},
84+
"Mammal": {
85+
"type": "object",
86+
"allOf": [ {
87+
"$ref": "#/components/schemas/Animal"
88+
} ],
89+
"properties": {
90+
"gender": {
91+
"type": "string",
92+
"enum": [
93+
"female",
94+
"male"
95+
]
96+
}
97+
},
98+
"xml": {
99+
"name": "mammal"
100+
}
101+
},
102+
"Primate": {
103+
"required": [
104+
"name"
105+
],
106+
"type": "object",
107+
"allOf": [
108+
{
109+
"$ref": "#/components/schemas/Mammal"
110+
}
111+
],
112+
"properties": {
113+
"id": {
114+
"type": "integer",
115+
"format": "int64",
116+
"example": 10
117+
},
118+
"name": {
119+
"type": "string",
120+
"example": "jane doe"
121+
}
122+
},
123+
"xml": {
124+
"name": "primate"
125+
}
126+
}
127+
}
128+
}
129+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
quarkus.openapi-generator.codegen.spec.jsonproperty_openapi_yaml.base-package=org.acme.jsonproperty.gettersetter

0 commit comments

Comments
 (0)