Skip to content

Config Key warning but functionality works #1035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tmulle opened this issue Mar 6, 2025 · 8 comments · Fixed by #1089
Closed

Config Key warning but functionality works #1035

tmulle opened this issue Mar 6, 2025 · 8 comments · Fixed by #1089
Labels
area:client This item is related to the client extension

Comments

@tmulle
Copy link

tmulle commented Mar 6, 2025

For the generator configuration I am getting this warning from Quarkus even though the functionality appears to be working in my application.properties

Unrecognized configuration key "quarkus.openapi-generator.codegen.spec.openapi_json.config-key" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo

My application.properties setting is below where openapi_json is the openapi.json file being read.

quarkus.openapi-generator.codegen.spec.openapi_json.config-key=bcp_notification_client

I got that information from:
https://docs.quarkiverse.io/quarkus-openapi-generator/dev/client.html#config-key

Quarkus 3.19.1 and latest version of generator

@ricardozanini
Copy link
Member

I don't know how Quarkus identifies a property, but from our side this property is being ingested.

@gastaldi do you know how we get rid of these warnings?

@melloware
Copy link
Contributor

might be a @radcortez question

@radcortez
Copy link

Configuration set in the quarkus namespace is subject to additional validations, namely whether it is known or not. Most likely, the warning is now correctly issued, since we were not consistently warning for some case with: quarkusio/quarkus#45562

To be known to Quarkus, a configuration must be mapped in a @ConfigRoot, @ConfigMapping interface, which does not seem to be the case for this extension.

It also seems the preferred way of this extension to retrieve configuration is to use the programmatic API, instead of the type safe way of Quarkus configuration, which I would recommend.

@ricardozanini
Copy link
Member

@radcortez in summary, we have to review our configuration to use @ConfigRoot and @ConfigMapping? Not sure we are not mapping everything, but I'll take a look once I have the time.

@melloware
Copy link
Contributor

@ricardozanini i see why its because just a Map is used and things are looked up out of the map: https://github.com/quarkiverse/quarkus-openapi-generator/blob/main/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/CodegenConfig.java

Because Quarkus can't figure out the real config it throws this warning.

@ricardozanini
Copy link
Member

@melloware yea we should change that.

@radcortez
Copy link

Our Map support was not great, but I think we now cover most of the use cases:
https://smallrye.io/smallrye-config/3.11.4/config/mappings/

Please let me know if you cannot express the required use cases with the current functionality and I'll help.

@ricardozanini
Copy link
Member

@radcortez many thanks!

Map is important to us since the config depends on the openapi identification, which is dynamic. So, I will review the Config to ensure everything is mapped and documented to the correct annotations. If WARNs continue to spam, I'll talk to you.

@ricardozanini ricardozanini added the area:client This item is related to the client extension label Mar 13, 2025
ricardozanini added a commit to ricardozanini/quarkus-openapi-generator that referenced this issue Apr 3, 2025
github-actions bot pushed a commit that referenced this issue Apr 4, 2025
hbelmiro pushed a commit that referenced this issue Apr 5, 2025
Signed-off-by: Ricardo Zanini <[email protected]>
Co-authored-by: Ricardo Zanini <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:client This item is related to the client extension
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants