Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-7509

Compilation fails when using an OpenAPI document downloaded from Quarkus SwaggerUI

    XMLWordPrintable

Details

    Description

      Compilation fails when using an OpenAPI document downloaded from Quarkus SwaggerUI with the following error:

      /target/generated-sources/open-api-stream/org/kie/kogito/openapi/openapi/api/DefaultApi.java:[32,12] reference to Response is ambiguous
        both class org.kie.kogito.openapi.openapi.model.Response in org.kie.kogito.openapi.openapi.model and class javax.ws.rs.core.Response in javax.ws.rs.core match
      

      This happens due to a type defined as "Response" in the OpenAPI document. It's necessary to use Response's FQCN in DefaultApi.java.

      In the attached DefaultApi.java file one can seeĀ "import org.kie.kogito.openapi.openapi.model.Response;" on line 4 andĀ "import javax.ws.rs.core.Response;" on line 13.

      The DefaultApi.java file was generated from openapi.yaml, which has a "Response" type defined on line 210.

      A workaround for this is renaming that "Response" type defined in openapi.yaml to something else.

      A reproducer can be found in https://github.com/hbelmiro/KOGITO-7509

      Attachments

        Activity

          People

            hbelmiro@redhat.com Helber Belmiro
            hbelmiro@redhat.com Helber Belmiro
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: