Skip to content
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

OpenApi does not show all methods when used in conjunction with @EndpointDisabled in native #34765

Closed
manofthepeace opened this issue Jul 14, 2023 · 4 comments · Fixed by #35217
Labels
Milestone

Comments

@manofthepeace
Copy link
Contributor

Describe the bug

Note: the root cause may be; #34738, but it is weird that it still shows a method out of 2 in the same class when disabled by default.

When using @EndpointDisabled and having it disabled by default, OpenApi shows 1 of the 2 methods in the class whether the property to enable it is set or not.

tested with native build.

Expected behavior

GreetingResource has 2 methods

When EndpointDisabled is active, openApi should not show any methods for the class
When EndpointDisabled is not active, OpenApi should show both methods

Actual behavior

starting the app with
./target/openapi-resteasy-1.0.0-SNAPSHOT-runner or HELLO_ENABLED=true ./target/openapi-resteasy-1.0.0-SNAPSHOT-runner

http://localhost:8080/q/swagger-ui/ will show 1 of the 2 methods

How to Reproduce?

Reproducer: https://github.com/manofthepeace/quarkus-endpointdisabled-openapi

Steps to reproduce:
1- compile a native application
2- run the app (endpointdisabled is active by default)
3- check the swagger-ui one of the method will be shown, not the other, none should actually be shown
4- run the app with HELLO_ENABLED=true
5- check swagger-ui, same only method will be shown, but both should.

Output of uname -a or ver

Darwin Kernel Version 21.6.0

Output of java -version

OpenJDK Runtime Environment Temurin-17.0.7+7

GraalVM version (if different from Java)

graalvm-jdk-17

Quarkus version or git rev

3.2.0

Build tool (ie. output of mvnw --version or gradlew --version)

mvn 3.9.1

Additional information

No response

@manofthepeace manofthepeace added the kind/bug Something isn't working label Jul 14, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 14, 2023

/cc @EricWittmann (openapi), @MikeEdgar (openapi), @phillip-kruger (openapi)

@manofthepeace manofthepeace changed the title OpenApi does not show all methods when used in cunjunction with @EndpointDisabled in native OpenApi does not show all methods when used in conjunction with @EndpointDisabled in native Jul 14, 2023
@gsmet
Copy link
Member

gsmet commented Jul 20, 2023

I'm pretty sure OpenAPI has no idea about what @EndpointDisabled is doing but I will let the people pinged here confirm ^.

@manofthepeace
Copy link
Contributor Author

I'm pretty sure OpenAPI has no idea about what @EndpointDisabled is doing but I will let the people pinged here confirm ^.

I thought it could relate to that; #34313. Before that PR I was using a OASFilter to remove them manually.

@MikeEdgar
Copy link
Contributor

The issue here appears to be related to the paths being slightly different between RestEasy Reactive and the OpenAPI document. RestEasy has a trailing / which prevents a match against the path. I'll open a PR to correct it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants