We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to generate C code for an API with a model (task) that has two enums in it (TaskType and TaskStatus)
I'm seeing name collisions in the generated output, similar to an older (fixed) bug BUG: 4293
Here is the generated model header: (model/task.h):
// Enum for task typedef enum { fastapi_task__NULL = 0, fastapi_task__NIL, fastapi_task__DO_A, fastapi_task__DO_B, fastapi_task__DO_C } fastapi_task__e; // ... // Enum for task typedef enum { fastapi_task__NULL = 0, fastapi_task__NIL, fastapi_task__NOT_APPROVED, fastapi_task__NOT_READY, fastapi_task__NOT_ASSIGNED, fastapi_task__PENDING, fastapi_task__EXECUTING, fastapi_task__DONE } fastapi_task__e;
The two enums collide both the the NIL and NULL enum value and the name of of the typedef (fastapi_task__e).
Looking at the model-header.mustache, I see:
// Enum {{enumName}} for {{classVarName}} ...
I would expect to see the {{enumName}} ("TaskType" or "TaskStatus" ) embedded in the names, which would fix them for uniqueness.
Is my yaml missing something?
openapi-generator-cli-7.9.0.jar
https://gist.github.com/PeteFlugstad/8ca8bd25a7aed7015b6634ddd77560c4
$ java -jar openapi-generator-cli-7.9.0.jar generate -i task.yaml -g c -o output $ mkdir output/build $ cd output/build $ cmake .. $ make
#4293
Seems like the {{enumName}} field is not being parsed or populated correctly from the yaml.
The text was updated successfully, but these errors were encountered:
my take is to create another library called "native-nextgen" with the breaking changes
I think you commented on the wrong bug?
Sorry, something went wrong.
oh right. sorry
just replied to #12787 instead.
@PeteFlugstad if the enum name can be customized with the enumNameMappings option, would that fix your issue?
enumNameMappings
ref: https://github.com/openapitools/openapi-generator/blob/master/docs/customization.md#name-mapping
No branches or pull requests
Bug Report Checklist
Description
I'm trying to generate C code for an API with a model (task) that has two enums in it (TaskType and TaskStatus)
I'm seeing name collisions in the generated output, similar to an older (fixed) bug BUG: 4293
Here is the generated model header: (model/task.h):
The two enums collide both the the NIL and NULL enum value and the name of of the typedef (fastapi_task__e).
Looking at the model-header.mustache, I see:
I would expect to see the {{enumName}} ("TaskType" or "TaskStatus" ) embedded in the names, which would fix them for uniqueness.
Is my yaml missing something?
openapi-generator version
openapi-generator-cli-7.9.0.jar
OpenAPI declaration file content or url
https://gist.github.com/PeteFlugstad/8ca8bd25a7aed7015b6634ddd77560c4
Generation Details
openapi-generator-cli-7.9.0.jar
Steps to reproduce
Related issues/PRs
#4293
Suggest a fix
Seems like the {{enumName}} field is not being parsed or populated correctly from the yaml.
The text was updated successfully, but these errors were encountered: