ricardozanini opened a new issue, #4125:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/issues/4125

   ### Describe the bug
   
   When a workflow exposes an OpenAPI via Kogito, the presence of a `title` on 
the `workflowdata` object (introduced through the `outputSchema` extension) 
makes the generated OpenAPI reference that title inside the parent response 
schema. This results in a self-referential schema and the OpenAPI client 
generator (Quarkiverse OpenAPI Generator) emits broken models (e.g., 
`ShippingOutPayload1` referencing itself) with missing properties.
   
   ### Expected behavior
   
   - `workflowdata` should be a distinct object type containing the declared 
properties (e.g., `shipping`), and not resolve to the parent type.
   - No duplicate/numbered classes and all properties are preserved.
   
   ### Actual behavior
   
   Generated model classes are recursive/incorrect:
   - `ShippingOutPayload1` contains a field workflowdata of type 
`ShippingOutPayload1` (self-reference).
   - Real nested fields (e.g., shipping) are missing.
   - Duplicate, numbered classes (...1) appear.
   
   ### How to Reproduce?
   
   1. Define a workflow with `outputSchema` and Kogito emits a schema like:
   
   ```yaml
   components:
     schemas:
       shippinghandling_output:
         type: object
         properties:
           workflowdata:
             title: shippinghandling_output   # <- problematic
             type: object
             required: [shipping]
             properties:
               shipping:
                 type: string
           id:
             type: string
   ```
   2. Generate the JAX-RS client using Quarkiverse OpenAPI Generator.
   3. Inspect the generated POJOs.
   
   ### Output of `uname -a` or `ver`
   
   _No response_
   
   ### Output of `java -version`
   
   _No response_
   
   ### GraalVM version (if different from Java)
   
   _No response_
   
   ### Kogito version or git rev (or at least Quarkus version if you are using 
Kogito via Quarkus platform BOM)
   
   _No response_
   
   ### Build tool (ie. output of `mvnw --version` or `gradlew --version`)
   
   _No response_
   
   ### Additional information
   
   ### Scope / Suspected Root Cause
   - The `outputSchema` handling in Kogito’s OpenAPI generation assigns or 
propagates a title to the nested `workflowdata` that matches the parent 
schema’s title, causing name collision and self-reference in the resulting 
OpenAPI.
   
   ### Workaround
   - Remove the title from the `workflowdata` object in the generated OpenAPI or
   - Ensure `workflowdata` references a distinct component schema (e.g., 
`shippinghandling_data`) and is only $ref’d from paths.
   
   Probably Related:
   - https://github.com/apache/incubator-kie-kogito-runtimes/issues/4124


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to