Skip to content

Commit 28eaa3c

Browse files
Merge branch 'main' into bugfix/moqu-is-not-watching-file-changes
2 parents f280555 + 328757a commit 28eaa3c

File tree

91 files changed

+2781
-236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2781
-236
lines changed

.all-contributorsrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,8 @@
434434
"avatar_url": "https://avatars.githubusercontent.com/u/80655200?v=4",
435435
"profile": "https://dev.to/dellamas",
436436
"contributions": [
437-
"doc"
437+
"doc",
438+
"test"
438439
]
439440
},
440441
{

.github/dependabot.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,35 @@
1-
# To get started with Dependabot version updates, you'll need to specify which
2-
# package ecosystems to update and where the package manifests are located.
3-
# Please see the documentation for all configuration options:
4-
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5-
61
version: 2
72
updates:
3+
# Maven updates for main branch
84
- package-ecosystem: "maven"
95
directory: "/"
106
schedule:
117
interval: "daily"
8+
target-branch: "main"
129
ignore:
1310
- dependency-name: "org.apache.maven.plugins:maven-compiler-plugin"
11+
12+
# Maven updates for main-lts branch
13+
- package-ecosystem: "maven"
14+
directory: "/"
15+
schedule:
16+
interval: "daily"
17+
target-branch: "main-lts"
18+
ignore:
19+
- dependency-name: "org.apache.maven.plugins:maven-compiler-plugin"
20+
- dependency-name: "io.quarkus:quarkus-bom"
21+
- dependency-name: "io.quarkus.platform:quarkus-bom"
22+
23+
# GitHub Actions updates for main branch
24+
- package-ecosystem: "github-actions"
25+
directory: "/"
26+
schedule:
27+
interval: "weekly"
28+
target-branch: "main"
29+
30+
# GitHub Actions updates for main-lts branch
1431
- package-ecosystem: "github-actions"
1532
directory: "/"
1633
schedule:
17-
interval: "weekly"
34+
interval: "weekly"
35+
target-branch: "main-lts"

.github/project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
release:
2-
current-version: 2.9.0
2+
current-version: 2.10.0
33
next-version: 3.0.0-SNAPSHOT

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
matrix:
3131
os: [
3232
ubuntu-latest,
33-
# windows-latest - Disabled due to https://github.com/quarkiverse/quarkus-openapi-generator/pull/836#issuecomment-2457329495
33+
windows-latest
3434
]
3535
java: [
3636
{ 'version': '17' },
@@ -59,7 +59,7 @@ jobs:
5959
matrix:
6060
os: [
6161
ubuntu-latest,
62-
# windows-latest - Disabled due to https://github.com/quarkiverse/quarkus-openapi-generator/pull/836#issuecomment-2457329495
62+
windows-latest
6363
]
6464
java: [
6565
{ 'version': '17' },

.github/workflows/preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
1313
steps:
1414
- name: Download PR Artifact
15-
uses: dawidd6/action-download-artifact@v9
15+
uses: dawidd6/action-download-artifact@v11
1616
with:
1717
workflow: ${{ github.event.workflow_run.workflow_id }}
1818
workflow_conclusion: success

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
103103
<td align="center" valign="top" width="14.28%"><a href="https://github.com/yuhaibohotmail"><img src="https://avatars.githubusercontent.com/u/48646226?v=4?s=100" width="100px;" alt="yuhaibohotmail"/><br /><sub><b>yuhaibohotmail</b></sub></a><br /><a href="https://github.com/quarkiverse/quarkus-openapi-generator/commits?author=yuhaibohotmail" title="Code">💻</a> <a href="https://github.com/quarkiverse/quarkus-openapi-generator/commits?author=yuhaibohotmail" title="Tests">⚠️</a></td>
104104
<td align="center" valign="top" width="14.28%"><a href="https://jpsantistebanq.github.io/portfolio"><img src="https://avatars.githubusercontent.com/u/49204973?v=4?s=100" width="100px;" alt="Juan Piero Santisteban Quiroz"/><br /><sub><b>Juan Piero Santisteban Quiroz</b></sub></a><br /><a href="https://github.com/quarkiverse/quarkus-openapi-generator/commits?author=JPSantistebanQ" title="Code">💻</a> <a href="https://github.com/quarkiverse/quarkus-openapi-generator/commits?author=JPSantistebanQ" title="Tests">⚠️</a></td>
105105
<td align="center" valign="top" width="14.28%"><a href="https://github.com/joschi"><img src="https://avatars.githubusercontent.com/u/43951?v=4?s=100" width="100px;" alt="Jochen Schalanda"/><br /><sub><b>Jochen Schalanda</b></sub></a><br /><a href="https://github.com/quarkiverse/quarkus-openapi-generator/commits?author=joschi" title="Code">💻</a></td>
106-
<td align="center" valign="top" width="14.28%"><a href="https://dev.to/dellamas"><img src="https://avatars.githubusercontent.com/u/80655200?v=4?s=100" width="100px;" alt="Luis Fabrício De Llamas"/><br /><sub><b>Luis Fabrício De Llamas</b></sub></a><br /><a href="https://github.com/quarkiverse/quarkus-openapi-generator/commits?author=dellamas" title="Documentation">📖</a></td>
106+
<td align="center" valign="top" width="14.28%"><a href="https://dev.to/dellamas"><img src="https://avatars.githubusercontent.com/u/80655200?v=4?s=100" width="100px;" alt="Luis Fabrício De Llamas"/><br /><sub><b>Luis Fabrício De Llamas</b></sub></a><br /><a href="https://github.com/quarkiverse/quarkus-openapi-generator/commits?author=dellamas" title="Documentation">📖</a> <a href="https://github.com/quarkiverse/quarkus-openapi-generator/commits?author=dellamas" title="Tests">⚠️</a></td>
107107
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jghagemann"><img src="https://avatars.githubusercontent.com/u/42047435?v=4?s=100" width="100px;" alt="João Guilherme Hagemann"/><br /><sub><b>João Guilherme Hagemann</b></sub></a><br /><a href="https://github.com/quarkiverse/quarkus-openapi-generator/commits?author=jghagemann" title="Documentation">📖</a></td>
108108
</tr>
109109
</tbody>

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.12.0</version.org.openapitools>
14+
<version.org.openapitools>7.13.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/CodegenConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ enum ConfigName {
6969
PART_FILENAME_VALUE("part-filename-value"),
7070
USE_FIELD_NAME_IN_PART_FILENAME("use-field-name-in-part-filename"),
7171
ADDITIONAL_PROPERTIES_AS_ATTRIBUTE("additional-properties-as-attribute"),
72+
INITIALIZE_EMPTY_COLLECTIONS("initialize-empty-collections"),
7273
ADDITIONAL_REQUEST_ARGS("additional-request-args"),
7374
REMOVE_OPERATION_ID_PREFIX("remove-operation-id-prefix"),
7475
REMOVE_OPERATION_ID_PREFIX_DELIMITER("remove-operation-id-prefix-delimiter"),

client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/CommonItemConfig.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,10 @@ public interface CommonItemConfig {
183183
*/
184184
@WithName("additional-properties-as-attribute")
185185
Optional<String> additionalPropertiesAsAttribute();
186+
187+
/**
188+
* Initialise collections as empty instead of null
189+
*/
190+
@WithName("initialize-empty-collections")
191+
Optional<String> initializeEmptyCollections();
186192
}

client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/GeneratorProcessor.java

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ FeatureBuildItem feature() {
8484
}
8585

8686
@BuildStep
87-
void additionalBean(Capabilities capabilities, BuildProducer<AdditionalBeanBuildItem> producer) {
88-
87+
void registerOidcClientBean(Capabilities capabilities, BuildProducer<AdditionalBeanBuildItem> producer) {
8988
if (!isClassPresentAtRuntime(ABSTRACT_TOKEN_PRODUCER)) {
9089
LOGGER.debug("{} class not found in runtime, skipping OidcClientRequestFilterDelegate bean generation",
9190
ABSTRACT_TOKEN_PRODUCER);
@@ -101,7 +100,6 @@ void additionalBean(Capabilities capabilities, BuildProducer<AdditionalBeanBuild
101100
producer.produce(AdditionalBeanBuildItem.builder().addBeanClass(ClassicOidcClientRequestFilterDelegate.class)
102101
.setDefaultScope(DotName.createSimple(Dependent.class)).setUnremovable().build());
103102
}
104-
105103
}
106104

107105
@BuildStep
@@ -126,16 +124,12 @@ void produceCompositeProviders(AuthenticationRecorder recorder, List<AuthProvide
126124
}
127125

128126
@BuildStep
129-
@Record(ExecutionTime.STATIC_INIT)
127+
@Record(ExecutionTime.RUNTIME_INIT)
130128
void produceOauthAuthentication(CombinedIndexBuildItem beanArchiveBuildItem,
131-
BuildProducer<AuthProviderBuildItem> authenticationProviders, BuildProducer<SyntheticBeanBuildItem> beanProducer,
129+
BuildProducer<AuthProviderBuildItem> authenticationProviders,
130+
BuildProducer<SyntheticBeanBuildItem> beanProducer,
132131
OidcAuthenticationRecorder oidcRecorder) {
133132

134-
if (!isClassPresentAtRuntime(ABSTRACT_TOKEN_PRODUCER)) {
135-
LOGGER.debug("{} class not found in runtime, skipping OAuth bean generation", ABSTRACT_TOKEN_PRODUCER);
136-
return;
137-
}
138-
LOGGER.debug("{} class found in runtime, producing OAuth bean generation", ABSTRACT_TOKEN_PRODUCER);
139133
Collection<AnnotationInstance> authenticationMarkers = beanArchiveBuildItem.getIndex()
140134
.getAnnotationsWithRepeatable(OAUTH_AUTHENTICATION_MARKER, beanArchiveBuildItem.getIndex())
141135
.stream()
@@ -145,6 +139,24 @@ void produceOauthAuthentication(CombinedIndexBuildItem beanArchiveBuildItem,
145139
(existing, duplicate) -> existing))
146140
.values();
147141

142+
if (!isClassPresentAtRuntime(ABSTRACT_TOKEN_PRODUCER)) {
143+
if (!authenticationMarkers.isEmpty()) {
144+
throw new IllegalStateException(
145+
"OAuth2 flows detected in spec(s) " +
146+
authenticationMarkers.stream()
147+
.map(m -> m.value("openApiSpecId").asString())
148+
.distinct()
149+
.collect(Collectors.joining(", "))
150+
+
151+
" but quarkus-openapi-generator-oidc and quarkus-rest-client-oidc-filter or quarkus-oidc-client-reactive-filter are not on the classpath. "
152+
+
153+
"Please add those dependencies to your project. See https://docs.quarkiverse.io/quarkus-openapi-generator/dev/client.html#_oauth2_authentication");
154+
}
155+
LOGGER.debug("{} class not found in runtime, skipping OAuth bean generation", ABSTRACT_TOKEN_PRODUCER);
156+
return;
157+
}
158+
LOGGER.debug("{} class found in runtime, producing OAuth bean generation", ABSTRACT_TOKEN_PRODUCER);
159+
148160
Map<String, List<AnnotationInstance>> operationsBySpec = getOperationsBySpec(beanArchiveBuildItem);
149161

150162
for (AnnotationInstance authenticationMarker : authenticationMarkers) {
@@ -162,16 +174,19 @@ void produceOauthAuthentication(CombinedIndexBuildItem beanArchiveBuildItem,
162174
.annotation(OpenApiSpec.class)
163175
.addValue("openApiSpecId", openApiSpecId)
164176
.done()
177+
.addInjectionPoint(ClassType.create(DotName.createSimple(CredentialsProvider.class)))
165178
.addInjectionPoint(ClassType.create(OAuth2AuthenticationProvider.OidcClientRequestFilterDelegate.class),
166179
AnnotationInstance.builder(OidcClient.class).add("name", sanitizeAuthName(name)).build())
180+
.addInjectionPoint(ClassType.create(DotName.createSimple(CredentialsProvider.class)))
167181
.createWith(oidcRecorder.recordOauthAuthProvider(sanitizeAuthName(name), openApiSpecId, operations))
182+
.setRuntimeInit()
168183
.unremovable()
169184
.done());
170185
}
171186
}
172187

173188
@BuildStep
174-
@Record(ExecutionTime.STATIC_INIT)
189+
@Record(ExecutionTime.RUNTIME_INIT)
175190
void produceBasicAuthentication(CombinedIndexBuildItem beanArchiveBuildItem,
176191
BuildProducer<AuthProviderBuildItem> authenticationProviders, BuildProducer<SyntheticBeanBuildItem> beanProducer,
177192
AuthenticationRecorder recorder) {
@@ -204,13 +219,14 @@ void produceBasicAuthentication(CombinedIndexBuildItem beanArchiveBuildItem,
204219
.done()
205220
.addInjectionPoint(ClassType.create(DotName.createSimple(CredentialsProvider.class)))
206221
.createWith(recorder.recordBasicAuthProvider(sanitizeAuthName(name), openApiSpecId, operations))
222+
.setRuntimeInit()
207223
.unremovable()
208224
.done());
209225
}
210226
}
211227

212228
@BuildStep
213-
@Record(ExecutionTime.STATIC_INIT)
229+
@Record(ExecutionTime.RUNTIME_INIT)
214230
void produceBearerAuthentication(CombinedIndexBuildItem beanArchiveBuildItem,
215231
BuildProducer<AuthProviderBuildItem> authenticationProviders, BuildProducer<SyntheticBeanBuildItem> beanProducer,
216232
AuthenticationRecorder recorder) {
@@ -244,14 +260,15 @@ void produceBearerAuthentication(CombinedIndexBuildItem beanArchiveBuildItem,
244260
.done()
245261
.addInjectionPoint(ClassType.create(DotName.createSimple(CredentialsProvider.class)))
246262
.createWith(recorder.recordBearerAuthProvider(sanitizeAuthName(name), scheme, openApiSpecId, operations))
263+
.setRuntimeInit()
247264
.unremovable()
248265
.done());
249266

250267
}
251268
}
252269

253270
@BuildStep
254-
@Record(ExecutionTime.STATIC_INIT)
271+
@Record(ExecutionTime.RUNTIME_INIT)
255272
void produceApiKeyAuthentication(CombinedIndexBuildItem beanArchiveBuildItem,
256273
BuildProducer<AuthProviderBuildItem> authenticationProviders, BuildProducer<SyntheticBeanBuildItem> beanProducer,
257274
AuthenticationRecorder recorder) {
@@ -288,6 +305,7 @@ void produceApiKeyAuthentication(CombinedIndexBuildItem beanArchiveBuildItem,
288305
.addInjectionPoint(ClassType.create(DotName.createSimple(CredentialsProvider.class)))
289306
.createWith(recorder.recordApiKeyAuthProvider(sanitizeAuthName(name), openApiSpecId, apiKeyIn, apiKeyName,
290307
operations))
308+
.setRuntimeInit()
291309
.unremovable()
292310
.done());
293311
}

0 commit comments

Comments
 (0)