diff --git a/.all-contributorsrc b/.all-contributorsrc index 385de3a26..1c9ecff84 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -263,6 +263,16 @@ "contributions": [ "doc" ] + }, + { + "login": "gabriel-farache", + "name": "gabriel-farache", + "avatar_url": "https://avatars.githubusercontent.com/u/3036508?v=4", + "profile": "https://github.com/gabriel-farache", + "contributions": [ + "code", + "test" + ] } ], "contributorsPerLine": 7, diff --git a/.github/project.yml b/.github/project.yml index b598407e0..be4aa8569 100644 --- a/.github/project.yml +++ b/.github/project.yml @@ -1,3 +1,3 @@ release: - current-version: 2.2.13 + current-version: 2.2.14 next-version: 3.0.0-SNAPSHOT diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cea453453..785913612 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,10 +49,12 @@ jobs: run: mvn '-Dorg.slf4j.simpleLogger.log.org.openapitools=off' -B formatter:validate impsort:check verify --file pom.xml - name: Store PR id + if: github.event_name == 'pull_request' run: | echo ${{ github.event.number }} > ./client/docs/target/generated-docs/pr-id.txt - name: Publishing directory for PR preview + if: github.event_name == 'pull_request' uses: actions/upload-artifact@v3 with: name: site @@ -86,12 +88,14 @@ jobs: run: mvn -Presteasy-reactive '-Dorg.slf4j.simpleLogger.log.org.openapitools=off' -B formatter:validate impsort:check verify --file pom.xml - name: Store PR id + if: github.event_name == 'pull_request' run: | echo ${{ github.event.number }} > ./client/docs/target/generated-docs/pr-id.txt - name: Publishing directory for PR preview + if: github.event_name == 'pull_request' uses: actions/upload-artifact@v3 with: name: site path: ./client/docs/target/generated-docs - retention-days: 3 \ No newline at end of file + retention-days: 3 diff --git a/README.md b/README.md index c2b3d611a..276ea53e6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Quarkus - OpenAPI Generator -[![All Contributors](https://img.shields.io/badge/all_contributors-28-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-29-orange.svg?style=flat-square)](#contributors-) [![Build]()](https://github.com/quarkiverse/quarkus-openapi-generator/actions?query=workflow%3ABuild) [![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) @@ -73,6 +73,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d DennisGyldendahlJensenSparNord
DennisGyldendahlJensenSparNord

💻 Luan Ramalho
Luan Ramalho

📖 + + gabriel-farache
gabriel-farache

💻 ⚠️ + diff --git a/client/deployment/pom.xml b/client/deployment/pom.xml index dab74561d..f0265f972 100644 --- a/client/deployment/pom.xml +++ b/client/deployment/pom.xml @@ -11,7 +11,7 @@ Quarkus - Openapi Generator - Deployment - 7.0.1 + 7.1.0 2.0.9 4.3.1 2.1.18 diff --git a/client/deployment/src/main/resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute b/client/deployment/src/main/resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute index 756d2f348..f7a830a0b 100644 --- a/client/deployment/src/main/resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute +++ b/client/deployment/src/main/resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute @@ -199,11 +199,22 @@ public class CompositeAuthenticationProvider extends AbstractCompositeAuthentica {#for auth in oauthMethods.orEmpty} @jakarta.enterprise.context.Dependent {#if is-resteasy-reactive} - static class OidcClientRequestFilterDelegateImpl{auth_index} extends io.quarkus.oidc.client.reactive.filter.OidcClientRequestReactiveFilter implements io.quarkiverse.openapi.generator.providers.OAuth2AuthenticationProvider.OidcClientRequestFilterDelegate { - {#else} - static class OidcClientRequestFilterDelegateImpl{auth_index} extends io.quarkus.oidc.client.filter.OidcClientRequestFilter implements io.quarkiverse.openapi.generator.providers.OAuth2AuthenticationProvider.OidcClientRequestFilterDelegate { - {/if} + static class OidcClientRequestFilterDelegateImpl{auth_index} extends io.quarkus.oidc.client.reactive.filter.OidcClientRequestReactiveFilter implements io.quarkiverse.openapi.generator.providers.OAuth2AuthenticationProvider.OidcClientRequestFilterDelegate { + + private final String clientId = io.quarkiverse.openapi.generator.OpenApiGeneratorConfig.getSanitizedSecuritySchemeName("{auth.name}"); + + @Override + protected Optional clientId() { + return Optional.of(clientId); + } + @Override + public void filter(jakarta.ws.rs.client.ClientRequestContext requestContext) throws java.io.IOException { + filter((org.jboss.resteasy.reactive.client.spi.ResteasyReactiveClientRequestContext)requestContext); + } + } + {#else} + static class OidcClientRequestFilterDelegateImpl{auth_index} extends io.quarkus.oidc.client.filter.OidcClientRequestFilter implements io.quarkiverse.openapi.generator.providers.OAuth2AuthenticationProvider.OidcClientRequestFilterDelegate { private final String clientId = io.quarkiverse.openapi.generator.OpenApiGeneratorConfig.getSanitizedSecuritySchemeName("{auth.name}"); @Override @@ -211,5 +222,6 @@ public class CompositeAuthenticationProvider extends AbstractCompositeAuthentica return Optional.of(clientId); } } + {/if} {/for} } \ No newline at end of file diff --git a/client/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/OAuth2AuthenticationProvider.java b/client/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/OAuth2AuthenticationProvider.java index 0e4117b31..2a8915b14 100644 --- a/client/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/OAuth2AuthenticationProvider.java +++ b/client/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/OAuth2AuthenticationProvider.java @@ -57,7 +57,7 @@ private void validateConfig() { } } - public interface OidcClientRequestFilterDelegate { - void filter(T requestContext) throws IOException; + public interface OidcClientRequestFilterDelegate { + void filter(ClientRequestContext requestContext) throws IOException; } } diff --git a/client/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/UrlPatternMatcher.java b/client/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/UrlPatternMatcher.java index 1753bb923..819a85a65 100644 --- a/client/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/UrlPatternMatcher.java +++ b/client/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/UrlPatternMatcher.java @@ -64,7 +64,7 @@ */ public class UrlPatternMatcher { // Finds parameters in the URL pattern string. - private static final String URL_PARAM_REGEX = "\\{(\\w*?)\\}"; + private static final String URL_PARAM_REGEX = "\\{(\\S*?)\\}"; // Replaces parameter names in the URL pattern string to match parameters in URLs. private static final String URL_PARAM_MATCH_REGEX = "\\([%\\\\w-.\\\\~!\\$&'\\\\(\\\\)\\\\*\\\\+,;=:\\\\[\\\\]@]+?\\)"; diff --git a/client/runtime/src/test/java/io/quarkiverse/openapi/generator/providers/UrlPatternMatcherTest.java b/client/runtime/src/test/java/io/quarkiverse/openapi/generator/providers/UrlPatternMatcherTest.java index 352bc488f..9610f7bfd 100644 --- a/client/runtime/src/test/java/io/quarkiverse/openapi/generator/providers/UrlPatternMatcherTest.java +++ b/client/runtime/src/test/java/io/quarkiverse/openapi/generator/providers/UrlPatternMatcherTest.java @@ -31,7 +31,8 @@ private static Stream providePathsThatMatch() { Arguments.of("/{id}/pets/{id2}", "/1/pets/2?q=1&q2=2"), Arguments.of("/{id}/{foo}/{id2}", "/1/2/3?q=1&q2=2"), Arguments.of("/{id}/{foo}/{id2}", "/1/2/3"), - Arguments.of("/v2/pets/{id}", "/v2/pets/1")); + Arguments.of("/v2/pets/{id}", "/v2/pets/1"), + Arguments.of("/pets/{pet-id}/types/{type-id}", "/pets/1/types/2")); } } \ No newline at end of file diff --git a/pom.xml b/pom.xml index 030c9fbdb..09adba2a7 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ 11 UTF-8 UTF-8 - 3.5.0 + 3.5.2 1.1.0.Final 3.25.5 3.24.2