Closed blackenz closed 7 months ago
Hi @blackenz, how are you? Thank you for reporting!
I will try to reproduce the error here. Can you share the application.properties
config?
Thanks for the quick reply @mcruzdev. I forgot to leave my application properties. I leave it below:
quarkus.rest-client.logging.scope=request-response
quarkus.rest-client.proxy-address=127.0.0.1:8080
quarkus.tls.trust-all=true
quarkus.log.category."org.jboss.resteasy.client.logging".level=DEBUG
quarkus.openapi-generator.codegen.spec.api_json.additional-model-type-annotations=@JsonInclude(JsonInclude.Include.NON_NULL)
quarkus.openapi-generator.codegen.spec.api_json.custom-register-providers=pt.blackenz.apis.APIRequestFilter
I'm using this feature, since the OpenApi definition i'm using does not follow the specification for Security Schemes. So i am using this feature as a workaround to register a filter that injects the Authorization Header in all requests. Unfortunately, even if i define the filter anotated as a Provider, the filter gets executed, but for some reason i cannot explain, the headers are not being injected in the request, even if logging the headers, says they are. I was hoping this feature would make the filters work as expected.
Thank You
@blackenz can you try using additional-api-type-annotations
, instead? See: https://docs.quarkiverse.io/quarkus-openapi-generator/dev/index.html#_oauth2_authentication
If authentication support doesn’t suit your needs you can decide to disable it with enable-security-generation=false. In such case CompositeAuthenticationProvider and AuthenticationPropagationHeadersFactory wont be generated and used with your api. The option can be set globally with quarkus.openapi-generator.codegen.enable-security-generation or per api quarkus.openapi-generator.codegen.spec.my_spec_yml.enable-security-generation. Custom authentication provider can be used with additional-api-type-annotations
@blackenz we've removed this option in this PR: #431
See the release notes: https://github.com/quarkiverse/quarkus-openapi-generator/releases/tag/2.2.9
Thank you! @ricardozanini, I was very busy today. We need then to remove it from our documentation.
Actually the first link on README is redirecting to https://github.com/quarkiverse/quarkus-openapi-generator/blob/1.0.1/README.md documentation. Maybe that link is making confusion.
The documentation was changed by #656
@blackenz can you try using
additional-api-type-annotations
, instead? See: https://docs.quarkiverse.io/quarkus-openapi-generator/dev/index.html#_oauth2_authenticationIf authentication support doesn’t suit your needs you can decide to disable it with enable-security-generation=false. In such case CompositeAuthenticationProvider and AuthenticationPropagationHeadersFactory wont be generated and used with your api. The option can be set globally with quarkus.openapi-generator.codegen.enable-security-generation or per api quarkus.openapi-generator.codegen.spec.my_spec_yml.enable-security-generation. Custom authentication provider can be used with additional-api-type-annotations
Thank You @ricardozanini ! Even though the oauth2 doesn't suit my purposes, the additional-api-type-annotations
, did work for me.
@mcruzdev as you say, the documentation is very confusing at this point, and that was the main reason why I was trying to use the custom-register-providers
. I think the documentation should be taken a look at.
Thank You
@mcruzdev can you open a PR to fix the documentation?
Merged, sorry to not link with this issue #656
I'm trying to use the custom-register-providers configuration but i'm having trouble to do a mvn compile. I'm using version quarkus-openapi-generator version 2.3.0 , with Quarkus 3.7 and Java 21.
pom.xml contents:
Errors while building:
Is this a regression?
Best regards