Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-3034

Wrong behaviour of the AccessApi for the generated Quarkus REST Client

XMLWordPrintable

    • Critical

      The generated AccessApi of the quarkus client does not work for the Quarkus REST Client because it magically drops the last slash from the path.

      The generated AccessApi looks like:

      @RegisterRestClient
      @RegisterProvider(ApiExceptionMapper.class)
      @Path("/access/")
      public interface AccessApi {
          @GET
          @Produces({"application/json"})
          AccessPagination getPrincipalAccess(@QueryParam("application") String application, @QueryParam("username") String username, @HeaderParam("x-rh-identity") String xRhIdentity, @QueryParam("limit") @DefaultValue("10") Integer limit, @QueryParam("offset") @DefaultValue("0") Integer offset) throws ApiException, ProcessingException;
      }
      

      The problem is that the Quarkus REST Client extension is not respecting the value "/access/" from the "@Path" annotation.

      This issue has been reported in Quarkus several times. Examples:

      But since this is a behaviour that has been part of REST Client from a while, the Quarkus team is reluctant to change to avoid breaking changes. More context in https://github.com/quarkusio/quarkus/issues/41689.

      As a workaround, we need to configure the OpenAPI generator to place the "@Path("/access/")" at method level.

              jcarvaja@redhat.com Jose Carvajal Hilario
              jcarvaja@redhat.com Jose Carvajal Hilario
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: