-
Bug
-
Resolution: Done
-
Major
-
1.15.0.Final
-
None
-
False
-
False
-
-
-
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