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 auto-add-tags feature can't work with interface and some quarkus.rest.path processing errors. #40455

Open
yuhaibohotmail opened this issue May 4, 2024 · 1 comment
Labels

Comments

@yuhaibohotmail
Copy link

yuhaibohotmail commented May 4, 2024

Describe the bug

1. OpenAPI auto-add-tags feature can't work with interface

If the annotation is written on the interface

@Path("/hello1")
public interface IGreetingResource1 {
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    String hello();
}

The tag will not be automatically added.

  /base/api/hello1:
    get:
      operationId: IGreetingResource1_hello
      responses:
        "200":
          description: OK
          content:
            text/plain:
              schema:
                type: string

2. OpenAPI handled incorrectly with reactive-routes when setup quarkus.rest.path

  quarkus.http.root-path=/base
  quarkus.rest.path=/api
@RouteBase(path = "simple", produces = "text/plain")
public class SimpleRoutes {

    @Route(path = "ping" ,methods = Route.HttpMethod.GET) // the final path is /simple/ping
    void ping(RoutingContext rc) {
        rc.response().end("pong");
    }
}

According to the document description, the scope of quarkus.rest.path only includes quarkus rest, but the path of reactive router in the document generated by openapi is incorrect.

  /base/api/simple/ping:
    get:
      operationId: SimpleRoutes_ping
      responses:
        "204":
          description: No Content  

3. DevUI Endpoints is incorrect about quarkus rest

  quarkus.http.root-path=/base
  quarkus.rest.path=/api
屏幕截图 2024-05-04 161314
@Path("/hello")
public class GreetingResource {
@Path("/hello1")
public interface IGreetingResource1 {

Here the Reactive Router handling is correct

@RouteBase(path = "simple", produces = "text/plain")
public class SimpleRoutes {

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

quarkus-rest-path-demo.zip

Output of uname -a or ver

No response

Output of java -version

21

Quarkus version or git rev

3.10

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

maven

Additional information

No response

@yuhaibohotmail yuhaibohotmail added the kind/bug Something isn't working label May 4, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented May 4, 2024

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

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

No branches or pull requests

1 participant