Skip to content

Commit d8db703

Browse files
authored
Merge branch 'main' into mock-module
2 parents 49c986d + 556bab3 commit d8db703

File tree

166 files changed

+11930
-873
lines changed

Some content is hidden

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

166 files changed

+11930
-873
lines changed

.all-contributorsrc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,37 @@
387387
"contributions": [
388388
"code"
389389
]
390+
},
391+
{
392+
"login": "andybarilla",
393+
"name": "Andy Barilla",
394+
"avatar_url": "https://avatars.githubusercontent.com/u/5983808?v=4",
395+
"profile": "https://kranzilla.com/",
396+
"contributions": [
397+
"code",
398+
"test",
399+
"doc"
400+
]
401+
},
402+
{
403+
"login": "yuhaibohotmail",
404+
"name": "yuhaibohotmail",
405+
"avatar_url": "https://avatars.githubusercontent.com/u/48646226?v=4",
406+
"profile": "https://github.com/yuhaibohotmail",
407+
"contributions": [
408+
"code",
409+
"test"
410+
]
411+
},
412+
{
413+
"login": "JPSantistebanQ",
414+
"name": "Juan Piero Santisteban Quiroz",
415+
"avatar_url": "https://avatars.githubusercontent.com/u/49204973?v=4",
416+
"profile": "https://jpsantistebanq.github.io/portfolio",
417+
"contributions": [
418+
"code",
419+
"test"
420+
]
390421
}
391422
],
392423
"contributorsPerLine": 7,

.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.6.0
2+
current-version: 2.8.0
33
next-version: 3.0.0-SNAPSHOT

.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@v6
15+
uses: dawidd6/action-download-artifact@v8
1616
with:
1717
workflow: ${{ github.event.workflow_run.workflow_id }}
1818
workflow_conclusion: success

.github/workflows/quarkus-snapshot.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ jobs:
2626
if: github.actor == 'quarkusbot' || github.actor == 'quarkiversebot' || github.actor == '<ADMIN>'
2727

2828
steps:
29-
- name: Install yq
30-
run: sudo add-apt-repository ppa:rmescandon/yq && sudo apt update && sudo apt install yq -y
31-
3229
- name: Set up Java
3330
uses: actions/setup-java@v4
3431
with:

.github/workflows/snapshot_deploy.yml

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Snapshot Deploy
33
concurrency:
44
group: ${{ github.ref }}-${{ github.workflow }}
55
cancel-in-progress: true
6+
67
on:
78
workflow_dispatch:
89
push:
@@ -12,28 +13,16 @@ defaults:
1213
run:
1314
shell: bash
1415

16+
permissions:
17+
attestations: write
18+
id-token: write
19+
contents: read
20+
1521
jobs:
1622
deploy-snapshot:
17-
runs-on: ubuntu-latest
18-
name: Deploy Snapshot artifacts
19-
steps:
20-
- uses: actions/checkout@v4
21-
22-
- uses: actions/setup-java@v4
23-
with:
24-
distribution: 'temurin'
25-
java-version: 17
26-
cache: 'maven'
27-
server-id: 'ossrh'
28-
server-username: MAVEN_USERNAME
29-
server-password: MAVEN_PASSWORD
30-
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
31-
gpg-passphrase: MAVEN_GPG_PASSPHRASE
32-
33-
- name: Deploy ${{steps.metadata.outputs.next-version}}
34-
run: |
35-
mvn -B clean deploy -DskipTests -DperformRelease=true -Drelease
36-
env:
37-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
38-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
39-
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
23+
name: Deploy Snapshots
24+
uses: quarkiverse/.github/.github/workflows/perform-release.yml@main
25+
secrets: inherit
26+
with:
27+
ref: main
28+
version: 3.0.0-SNAPSHOT

.github/workflows/stale_issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
stale:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/stale@v9.0.0
14+
- uses: actions/stale@v9.1.0
1515
with:
1616
exempt-issue-labels: "pinned"
1717
stale-issue-message: "@ricardozanini @hbelmiro This is being labeled as Stale."

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,32 @@
88
<br>
99

1010
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
11-
[![All Contributors](https://img.shields.io/badge/all_contributors-41-orange.svg?style=flat-square)](#contributors-)
11+
[![All Contributors](https://img.shields.io/badge/all_contributors-44-orange.svg?style=flat-square)](#contributors-)
1212
<!-- ALL-CONTRIBUTORS-BADGE:END -->
1313
[![Build](<https://img.shields.io/github/actions/workflow/status/quarkiverse/quarkus-openapi-generator/build.yml?branch=main&logo=GitHub&style=flat-square>)](https://github.com/quarkiverse/quarkus-openapi-generator/actions?query=workflow%3ABuild)
1414
[![Maven Central](https://img.shields.io/maven-central/v/io.quarkiverse.openapi.generator/quarkus-openapi-generator.svg?label=Maven%20Central&style=flat-square)](https://search.maven.org/artifact/io.quarkiverse.openapi.generator/quarkus-openapi-generator)
1515
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0)
1616

17-
18-
> **⚠️** This is the instructions for the latest SNAPSHOT version (main branch). Please, see the [latest **released** documentation](https://docs.quarkiverse.io/quarkus-openapi-generator/dev/index.html) if you are looking for instructions.
19-
20-
> **⚠️** This extension, [like Quarkus 3.7](https://quarkus.io/blog/java-17/), requires Java 17. The last version of this extension that supports earlier versions of Java is [2.2.16](https://github.com/quarkiverse/quarkus-openapi-generator/releases/tag/2.2.16).
21-
22-
> **⚠️** Check versions 1.x.x if you're still using Quarkus 2. But be aware that we no longer support Quarkus 2. That means there are no updates planned for those versions.
23-
2417
Quarkus' extensions for generation of [Rest Clients](https://quarkus.io/guides/rest-client) and server stubs generation based on the [Apicurio Codegen](https://github.com/Apicurio/apicurio-codegen) capabilities based on OpenAPI specification files.
2518

26-
This client-side extension is based on the [OpenAPI Generator Tool](https://openapi-generator.tech/). Please consider donation to help them maintain the
19+
This client-side extension is based on the [OpenAPI Generator Tool](https://openapi-generator.tech/). Please consider a donation to help them maintain the
2720
project: https://opencollective.com/openapi_generator/donate
2821

29-
This repository holds two Quarkus extensions. The one located on the client folder is for REST code generation for client side only. The extension located in the server folder can be used for server stubs generation.
22+
This repository holds two Quarkus extensions. The one located in the client folder is for REST code generation for client-side only. The extension located in the server folder can be used for server stubs generation.
23+
24+
> [!WARNING]
25+
> This extension, [like Quarkus 3.7](https://quarkus.io/blog/java-17/), requires Java 17. The last version of this extension that supports earlier versions of Java is [2.2.16](https://github.com/quarkiverse/quarkus-openapi-generator/releases/tag/2.2.16).
26+
27+
> [!CAUTION]
28+
> Check versions 1.x.x if you're still using Quarkus 2. But be aware that we no longer support Quarkus 2. That means there are no updates planned for those versions.
3029
3130
**Want to contribute? Great!** We try to make it easy, and all contributions, even the smaller ones, are more than welcome. This includes bug reports, fixes, documentation, examples... But first, read [this page](CONTRIBUTING.md).
3231

3332
## Getting Started
3433

3534
You can learn more in [Quarkus Openapi Generator Documentation](http://docs.quarkiverse.io/quarkus-openapi-generator/dev/index.html).
3635

37-
36+
> [!TIP]
3837
> If you want to improve the docs, please feel free to contribute editing the docs in [Docs](https://github.com/quarkiverse/quarkus-openapi-generator/tree/main/docs/modules/ROOT). But first, read [this page](CONTRIBUTING.md).
3938
4039
## Contributors ✨
@@ -98,6 +97,11 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
9897
<td align="center" valign="top" width="14.28%"><a href="https://github.com/michalkolenda"><img src="https://avatars.githubusercontent.com/u/29705783?v=4?s=100" width="100px;" alt="Michał Kolenda"/><br /><sub><b>Michał Kolenda</b></sub></a><br /><a href="https://github.com/quarkiverse/quarkus-openapi-generator/commits?author=michalkolenda" title="Code">💻</a></td>
9998
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rednalyn"><img src="https://avatars.githubusercontent.com/u/31593992?v=4?s=100" width="100px;" alt="rednalyn"/><br /><sub><b>rednalyn</b></sub></a><br /><a href="https://github.com/quarkiverse/quarkus-openapi-generator/commits?author=rednalyn" title="Documentation">📖</a></td>
10099
<td align="center" valign="top" width="14.28%"><a href="https://github.com/marko-bekhta"><img src="https://avatars.githubusercontent.com/u/4004823?v=4?s=100" width="100px;" alt="Marko Bekhta"/><br /><sub><b>Marko Bekhta</b></sub></a><br /><a href="https://github.com/quarkiverse/quarkus-openapi-generator/commits?author=marko-bekhta" title="Code">💻</a></td>
100+
<td align="center" valign="top" width="14.28%"><a href="https://kranzilla.com/"><img src="https://avatars.githubusercontent.com/u/5983808?v=4?s=100" width="100px;" alt="Andy Barilla"/><br /><sub><b>Andy Barilla</b></sub></a><br /><a href="https://github.com/quarkiverse/quarkus-openapi-generator/commits?author=andybarilla" title="Code">💻</a> <a href="https://github.com/quarkiverse/quarkus-openapi-generator/commits?author=andybarilla" title="Tests">⚠️</a> <a href="https://github.com/quarkiverse/quarkus-openapi-generator/commits?author=andybarilla" title="Documentation">📖</a></td>
101+
</tr>
102+
<tr>
103+
<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>
104+
<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>
101105
</tr>
102106
</tbody>
103107
</table>

client/deployment/pom.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<name>Quarkus - Openapi Generator - Client - Deployment</name>
1212

1313
<properties>
14-
<version.org.openapitools>7.8.0</version.org.openapitools>
14+
<version.org.openapitools>7.11.0</version.org.openapitools>
1515
<version.org.slf4j>2.0.16</version.org.slf4j>
1616
<version.com.github.jknack>4.3.1</version.com.github.jknack>
17-
<version.io.swagger.parser>2.1.24</version.io.swagger.parser>
17+
<version.io.swagger.parser>2.1.25</version.io.swagger.parser>
1818
</properties>
1919

2020
<dependencies>
@@ -36,6 +36,11 @@
3636
<artifactId>quarkus-openapi-generator</artifactId>
3737
<version>${project.version}</version>
3838
</dependency>
39+
<dependency>
40+
<groupId>io.quarkiverse.openapi.generator</groupId>
41+
<artifactId>quarkus-openapi-generator-oidc</artifactId>
42+
<version>${project.version}</version>
43+
</dependency>
3944
<!-- Forces swagger-parser version to avoid conflict with Quarkus.
4045
This is needed while org.openapitools:openapi-generator doesn't use swagger-parser 2.1.13 or greater -->
4146
<dependency>
@@ -164,9 +169,6 @@
164169
<version>${quarkus.version}</version>
165170
</path>
166171
</annotationProcessorPaths>
167-
<compilerArgs>
168-
<arg>-AlegacyConfigRoot=true</arg>
169-
</compilerArgs>
170172
</configuration>
171173
</execution>
172174
</executions>

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

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,32 @@
77
import java.util.stream.Collectors;
88

99
import io.quarkiverse.openapi.generator.deployment.codegen.OpenApiGeneratorOutputPaths;
10-
import io.quarkus.runtime.annotations.ConfigItem;
1110
import io.quarkus.runtime.annotations.ConfigPhase;
1211
import io.quarkus.runtime.annotations.ConfigRoot;
12+
import io.smallrye.config.ConfigMapping;
13+
import io.smallrye.config.WithName;
1314
import io.smallrye.config.common.utils.StringUtil;
1415

1516
// This configuration is read in codegen phase (before build time), the annotation is for document purposes and avoiding quarkus warns
16-
@ConfigRoot(name = CodegenConfig.CODEGEN_TIME_CONFIG_PREFIX, phase = ConfigPhase.BUILD_TIME)
17-
public class CodegenConfig extends GlobalCodegenConfig {
17+
@ConfigRoot(phase = ConfigPhase.BUILD_TIME)
18+
@ConfigMapping(prefix = "quarkus." + CodegenConfig.CODEGEN_TIME_CONFIG_PREFIX)
19+
public interface CodegenConfig extends GlobalCodegenConfig {
1820

19-
static final String CODEGEN_TIME_CONFIG_PREFIX = "openapi-generator.codegen";
21+
String CODEGEN_TIME_CONFIG_PREFIX = "openapi-generator.codegen";
2022

21-
public static final String API_PKG_SUFFIX = ".api";
22-
public static final String MODEL_PKG_SUFFIX = ".model";
23+
String API_PKG_SUFFIX = ".api";
24+
String MODEL_PKG_SUFFIX = ".model";
2325

24-
public static final String ADDITIONAL_ENUM_TYPE_UNEXPECTED_MEMBER_NAME_DEFAULT = "UNEXPECTED";
25-
public static final String ADDITIONAL_ENUM_TYPE_UNEXPECTED_MEMBER_STRING_VALUE_DEFAULT = "unexpected";
26+
String ADDITIONAL_ENUM_TYPE_UNEXPECTED_MEMBER_NAME_DEFAULT = "UNEXPECTED";
27+
String ADDITIONAL_ENUM_TYPE_UNEXPECTED_MEMBER_STRING_VALUE_DEFAULT = "unexpected";
2628
// package visibility for unit tests
27-
static final String BUILD_TIME_GLOBAL_PREFIX_FORMAT = "quarkus." + CODEGEN_TIME_CONFIG_PREFIX + ".%s";
28-
static final String BUILD_TIME_SPEC_PREFIX_FORMAT = "quarkus." + CODEGEN_TIME_CONFIG_PREFIX + ".spec.%s";
29+
String BUILD_TIME_GLOBAL_PREFIX_FORMAT = "quarkus." + CODEGEN_TIME_CONFIG_PREFIX + ".%s";
30+
String BUILD_TIME_SPEC_PREFIX_FORMAT = "quarkus." + CODEGEN_TIME_CONFIG_PREFIX + ".spec.%s";
2931

30-
public static final List<String> SUPPORTED_CONFIGURATIONS = Arrays.stream(ConfigName.values()).map(cn -> cn.name)
32+
List<String> SUPPORTED_CONFIGURATIONS = Arrays.stream(ConfigName.values()).map(cn -> cn.name)
3133
.collect(Collectors.toList());
3234

33-
public enum ConfigName {
35+
enum ConfigName {
3436
//global configs
3537
VERBOSE("verbose"),
3638
INPUT_BASE_DIR("input-base-dir"),
@@ -58,6 +60,7 @@ public enum ConfigName {
5860
ADDITIONAL_API_TYPE_ANNOTATIONS("additional-api-type-annotations"),
5961
TYPE_MAPPINGS("type-mappings"),
6062
IMPORT_MAPPINGS("import-mappings"),
63+
SCHEMA_MAPPINGS("schema-mappings"),
6164
NORMALIZER("open-api-normalizer"),
6265
RETURN_RESPONSE("return-response"),
6366
ENABLE_SECURITY_GENERATION("enable-security-generation"),
@@ -67,7 +70,14 @@ public enum ConfigName {
6770
USE_FIELD_NAME_IN_PART_FILENAME("use-field-name-in-part-filename"),
6871
ADDITIONAL_PROPERTIES_AS_ATTRIBUTE("additional-properties-as-attribute"),
6972
ADDITIONAL_REQUEST_ARGS("additional-request-args"),
70-
BEAN_VALIDATION("use-bean-validation");
73+
REMOVE_OPERATION_ID_PREFIX("remove-operation-id-prefix"),
74+
REMOVE_OPERATION_ID_PREFIX_DELIMITER("remove-operation-id-prefix-delimiter"),
75+
REMOVE_OPERATION_ID_PREFIX_COUNT("remove-operation-id-prefix-count"),
76+
GENERATE_APIS("generate-apis"),
77+
GENERATE_MODELS("generate-models"),
78+
BEAN_VALIDATION("use-bean-validation"),
79+
SERIALIZABLE_MODEL("serializable-model"),
80+
EQUALS_HASHCODE("equals-hashcode");
7181

7282
private final String name;
7383

@@ -80,28 +90,28 @@ public enum ConfigName {
8090
/**
8191
* OpenAPI Spec details for codegen configuration.
8292
*/
83-
@ConfigItem(name = "spec")
84-
public Map<String, SpecItemConfig> specItem;
93+
@WithName("spec")
94+
Map<String, SpecItemConfig> specItem();
8595

86-
public static String resolveApiPackage(final String basePackage) {
96+
static String resolveApiPackage(final String basePackage) {
8797
return String.format("%s%s", basePackage, API_PKG_SUFFIX);
8898
}
8999

90-
public static String resolveModelPackage(final String basePackage) {
100+
static String resolveModelPackage(final String basePackage) {
91101
return String.format("%s%s", basePackage, MODEL_PKG_SUFFIX);
92102
}
93103

94104
/**
95105
* Return global config name, openapi-generator.codegen.config-name
96106
*/
97-
public static String getGlobalConfigName(ConfigName configName) {
107+
static String getGlobalConfigName(ConfigName configName) {
98108
return String.format(BUILD_TIME_GLOBAL_PREFIX_FORMAT, configName.name);
99109
}
100110

101111
/**
102112
* Return spec config name openapi-generator.codegen.spec.%s.config-name
103113
*/
104-
public static String getSpecConfigName(ConfigName configName, final Path openApiFilePath) {
114+
static String getSpecConfigName(ConfigName configName, final Path openApiFilePath) {
105115
return String.format("%s.%s", getBuildTimeSpecPropertyPrefix(openApiFilePath), configName.name);
106116
}
107117

@@ -111,7 +121,7 @@ public static String getSpecConfigName(ConfigName configName, final Path openApi
111121
* returned value is
112122
* <code>openapi.generator.codegen.spec.petstore.mutiny</code>.
113123
*/
114-
public static String getSpecConfigNameByConfigKey(final String configKey, final ConfigName configName) {
124+
static String getSpecConfigNameByConfigKey(final String configKey, final ConfigName configName) {
115125
String buildTimeSpecPropertyPrefix = String.format(BUILD_TIME_SPEC_PREFIX_FORMAT, configKey);
116126
return String.format("%s.%s", buildTimeSpecPropertyPrefix, configName.name);
117127
}
@@ -122,11 +132,11 @@ public static String getSpecConfigNameByConfigKey(final String configKey, final
122132
* `quarkus.openapi-generator."petstore_json"`.
123133
* Every the periods (.) in the file name will be replaced by underscore (_).
124134
*/
125-
public static String getBuildTimeSpecPropertyPrefix(final Path openApiFilePath) {
135+
static String getBuildTimeSpecPropertyPrefix(final Path openApiFilePath) {
126136
return String.format(BUILD_TIME_SPEC_PREFIX_FORMAT, getSanitizedFileName(openApiFilePath));
127137
}
128138

129-
public static String getSanitizedFileName(final Path openApiFilePath) {
139+
static String getSanitizedFileName(final Path openApiFilePath) {
130140
return StringUtil
131141
.replaceNonAlphanumericByUnderscores(OpenApiGeneratorOutputPaths.getRelativePath(openApiFilePath).toString());
132142
}

0 commit comments

Comments
 (0)