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

Using Same OpenAPI Function definition in multiple Workflows throws compile error

XMLWordPrintable

    • False
    • False
    • Hide
      1. Create two workflows referencing the same OpenAPI document in both
      2. Build project 
        mvn compile quarkus:dev
      1. See error
      Show
      Create two workflows referencing the same OpenAPI document in both Build project  mvn compile quarkus:dev See error
    • 2022 Week 02-04 (from Jan 10)

      Defining the same API Operation in a Function Block such as in multiple workflows:

       

      functions:  
      - name: sendCallToApi    
        operation: specs/pets.yaml#getPetById 
      
      

      Throws a compile error as the Generated API Objects already exist. Asking to re-generate as part of another workflow causes this error.

       

      Note: This error is present regardless of method of OpenAPI referencing (HTTP or File).

      2022-01-17 13:29:40,080 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-36) src/main/java/org/kie/kogito/app/openapi/client/aHR0cHM6Ly9wZXRzdG9yZTMuc3dhZ2dlci5pby9hcGkvdjMvb3BlbmFwaS55YW1s_openapi/PetApi.java (16:1002) : The type PetApi is already defined
      2022-01-17 13:29:40,080 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-36) src/main/java/org/kie/kogito/app/openapi/client/aHR0cHM6Ly9wZXRzdG9yZTMuc3dhZ2dlci5pby9hcGkvdjMvb3BlbmFwaS55YW1s_openapi/StoreApi.java (16:1027) : The type StoreApi is already defined
      ....
      
          [error]: Build step org.kie.kogito.quarkus.common.deployment.KogitoAssetsProcessor#generateModel threw an exception: java.lang.IllegalStateException: src/main/java/org/kie/kogito/app/openapi/client/aHR0cHM6Ly9wZXRzdG9yZTMuc3dhZ2dlci5pby9hcGkvdjMvb3BlbmFwaS55YW1s_openapi/PetApi.java (16:1002) : The type PetApi is already defined
      src/main/java/org/kie/kogito/app/openapi/client/aHR0cHM6Ly9wZXRzdG9yZTMuc3dhZ2dlci5pby9hcGkvdjMvb3BlbmFwaS55YW1s_openapi/StoreApi.java (16:1027) : The type StoreApi is already defined
      src/main/java/org/kie/kogito/app/openapi/client/aHR0cHM6Ly9wZXRzdG9yZTMuc3dhZ2dlci5pby9hcGkvdjMvb3BlbmFwaS55YW1s_openapi/UserApi.java (15:981) : The type UserApi is already defined
      
      ...
      src/main/java/org/kie/kogito/app/openapi/client/aHR0cHM6Ly9wZXRzdG9yZTMuc3dhZ2dlci5pby9hcGkvdjMvb3BlbmFwaS55YW1s_openapi/PetApi.java (16:1002) : The type PetApi is already definedsrc/main/java/org/kie/kogito/app/openapi/client/aHR0cHM6Ly9wZXRzdG9yZTMuc3dhZ2dlci5pby9hcGkvdjMvb3BlbmFwaS55YW1s_openapi/StoreApi.java (16:1027) : The type StoreApi is already definedsrc/main/java/org/kie/kogito/app/openapi/client/aHR0cHM6Ly9wZXRzdG9yZTMuc3dhZ2dlci5pby9hcGkvdjMvb3BlbmFwaS55YW1s_openapi/UserApi.java (15:981) : The type UserApi is already definedsrc/main/java/org/kie/kogito/app/openapi/client/aHR0cHM6Ly9wZXRzdG9yZTMuc3dhZ2dlci5pby9hcGkvdjMvb3BlbmFwaS55YW1s_openapi/ApiClient.java (48:2251) : The type ApiClient is already 
      ...

       

       

      • This limits users to use the same API in 1 Workflow only.

      Expected Behavior

      • Able to resuse the same OpenAPI function definitions in as many workflows within the same application, without having to define a shared resource
      • Generator does not error, but identifies resources as already present and skips re-generation

              hbelmiro@redhat.com Helber Belmiro
              prattyush.mangal@ibm.com Prattyush Mangal (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: