OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.49k stars 6.5k forks source link

[BUG][JAVA] Enum DTO is generated empty #17551

Open stanislav-georgiev-tt opened 9 months ago

stanislav-georgiev-tt commented 9 months ago
Description

My issue is that the DTO generated out of this schema:

"serverroutersv0_set_session_paramRequest__eParam": { "type": "string", "enum": [
"workshop", "apparatus", "dataset" ], "title": "eParam" }

is empty, however having similar schema:

"serverroutersv0_predict_processeParam": { "type": "string", "enum": [ "predictProcess", "predictFinalProductInKg" ], "title": "eParam" }

successfully generates me complete DTO. I tried to edit the fields of the enum thinking that I might use some keyword but without success. My specification is v3.1.0

openapi-generator version

7.2.0 maven plugin

OpenAPI declaration file content or url
Generation Details
stanislav-georgiev-tt commented 9 months ago

I have fixed the problem by reordering the schema definition inside my specification. Placing the problematic schema before the other one now gives me successful generation. Interesting how the generated interprets the order.