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

Subresource Paths are not grouped under Resource Tags #1618

Closed
jbuvv opened this issue Oct 20, 2023 · 1 comment · Fixed by #1619
Closed

Subresource Paths are not grouped under Resource Tags #1618

jbuvv opened this issue Oct 20, 2023 · 1 comment · Fixed by #1619
Assignees
Labels
bug Something isn't working

Comments

@jbuvv
Copy link

jbuvv commented Oct 20, 2023

Hello!

We are using the following Pattern in our Application:

@Tag("My Tag")
@Path("/myparent")
@ApplicationScoped
class MyResource {
  @Inject MySubResource r;
  @Path("/mysub")
  public MySubResource getMySubResource() { return r; }
}
@ApplicationScoped
class MySubResource {
  @GET
  @Path("/hello")
  @Operation(summary = "myop")
  public String getHello() { return "hi"; }
}

So we have just a single Endpoint '/myparent/mysub/hello'.
I would expect the EP to have the "My Tag"-Tag but instead it has none.

I suspect the Tag is missing because the Tags are not forwarded to the function that processes the subresources:

processSubResource(context, resourceClass, methodInfo, openApi, locatorPathParameters);

Is that the intended behavior?

@MikeEdgar MikeEdgar added the bug Something isn't working label Oct 20, 2023
@MikeEdgar MikeEdgar self-assigned this Oct 20, 2023
@MikeEdgar
Copy link
Member

I'd say this is a bug, also discussed in #1546. Just like a @Tag on a resource method overrides a @Tag on the parent resource class, it would probably make sense to a @Tag on the subresource producer method to override a @Tag present on the sub-resource class.

@Tag order of priority:

  1. Directly on resource method
  2. On nearest subresource producer method (when operation is in a subresource)
  3. On nearest subresource class (when operation is in a subresource)
  4. On root resource class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants