-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Setting "quarkus.smallrye-openapi.open-api-version" in application.yml has no effect #31197
Comments
/cc @EricWittmann (openapi), @Ladicek (smallrye), @MikeEdgar (openapi), @jmartisk (smallrye), @phillip-kruger (openapi,smallrye), @radcortez (smallrye) |
Have you tried
see https://quarkus.io/guides/openapi-swaggerui#changing-the-openapi-version |
@phillip-kruger Yep, that's my current workaround -- works in both
I guess I'm not sure if this is a Quarkus bug, a documentation bug, or simply me misunderstanding the documentation.
If I can use In summary, this code added to
However, this code added to
This is the code I have to use in
|
It might not have been mapped. Let me check. Hold on |
Yes it's not mapped. If you keen you can do a PR for that ? It's basically a mapping here: https://github.com/quarkusio/quarkus/blob/main/extensions/smallrye-openapi/runtime/src/main/java/io/quarkus/smallrye/openapi/runtime/OpenApiConfigMapping.java |
Sure thing, I'll give it a shot in the AM. This'll be my first time contributing to a public repo, so I might have some more questions tomorrow. Thanks for investigating & pointing me at the relevant code! |
Actually, is the existing code mapping the wrong
According to the Seems to be the above line should be changed to this:
The value of |
Yes ! Good catch ! That should solve it. So it was mapped to a constant and not the config key. Please make a PR with your change ! |
Will do, tx again! |
@phillip-kruger I have a local branch building with the code fix; now I want to build a test or two, to confirm the fix. Here are the two existing tests that most closely approximate the tests I want to build:
However, I'm not sure what terminal command I should use. I tried this to run a single test, but it doesn't work:
Btw, if there's a better forum for asking these types of questions, please say the word & I'll repost there instead. This is all a bit new to me. |
Hi @jehrenzweig-leagueapps , no worries you can ask here. Try this: (I usually cd into the extension/deployment folder)
|
Getting closer. I ran this command:
Which returns the following error:
|
it's surefire:test not surefire:tests (note the s). |
And on Windows you might have to put the test in "" ,so :
|
🤦 Well, at least it was something simple. Got the existing test case running just now -- thank you! Will resume writing my own tests in the AM. |
@phillip-kruger I forked the repo & created a draft PR for review here: #31302 Unfortunately, I'm still not able to get my proposed code fix working properly. I tried updating the existing |
Updated OpenAPI `mp.openapi.extensions.smallrye.openapi` key mapping
I am able to configure the version using mp.openapi.extensions.smallrye.openapi when running dev UI, and by using openApiVersion configuration when using the maven plugin. |
For the maven plugin you need to use maven properties. Also, I am not sure if all properties is supported in the maven plugin. |
Describe the bug
The following code in a Quarkus project's
application.yml
file will not change the generated OpenAPI document'sopenapi:
root property value, as the documentation on the "Using OpenAPI and Swagger UI" page indicates it should:Expected behavior
Quarkus 2.16.2.Final targets OpenAPI 3.0.3 by default. However, if you attempt to override this value with an earlier supported version (e.g. 3.0.1) in
application.yml
, the override value should appear in the rootopenapi:
property in the OpenAPI document generated by the URL/q/openapi?format=json
.Example:
Actual behavior
Quarkus' default OpenAPI value (3.0.3) is still visible in the OpenAPI document generated by the URL
/q/openapi?format=json
; the value defined inapplication.yml
is not applied.Example:
How to Reproduce?
Steps to reproduce the behavior:
/q/openapi?format=json
URL route, as described here.application.yml
code so that theopen-api-version
property value is set to3.0.1
:Output of
uname -a
orver
Darwin LeagueAppss-MacBook-Pro.local 21.6.0 Darwin Kernel Version 21.6.0: Thu Sep 29 20:12:57 PDT 2022; root:xnu-8020.240.7~1/RELEASE_X86_64 x86_64
Output of
java -version
openjdk version "17.0.5" 2022-10-18
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.16.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 7.5.1
Additional information
No response
The text was updated successfully, but these errors were encountered: