You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a simple enum is referenced in an object properties, it's missing in the model body (_create function) and header (model struct).
openapi-generator version
master branch on 2020-03-17T10:41:00Z.
Don't really know if it's a regression, I tried using the latest stable version too, but then I was mainly stuck with #5477 (this is why I'm using the master branch)
Here is the model header file with error commented: object_dummy.h
Here is the model body file with error commented: object_dummy.c
To get the compiler errors, just try to compile the generated code, it will be much simpler.
Related issues/PRs
My last pull request #5604 that fixed a problem that was still present after #5477 was merged
Suggest a fix
A fix could be something like the following fix, as stated in the debugModels output, the referenced enum is considered as "^isModel" and "^isPrimitiveType", so we have to add a third case : an enum that is neither a model nor a primitive type.
Although maybe it should be considered as a model, and that this causes the bug, but I'm not enough familiar with those definitions to be sure.
Bug Report Checklist
Description
When a simple enum is referenced in an object properties, it's missing in the model body (_create function) and header (model struct).
openapi-generator version
master branch on 2020-03-17T10:41:00Z.
Don't really know if it's a regression, I tried using the latest stable version too, but then I was mainly stuck with #5477 (this is why I'm using the master branch)
OpenAPI declaration file content or url
enum-bug.yaml
Command line used for generation
Steps to reproduce
Here is the debugModels output:
debug_models.txt
Here is the model header file with error commented:
object_dummy.h
Here is the model body file with error commented:
object_dummy.c
To get the compiler errors, just try to compile the generated code, it will be much simpler.
Related issues/PRs
My last pull request #5604 that fixed a problem that was still present after #5477 was merged
Suggest a fix
A fix could be something like the following fix, as stated in the debugModels output, the referenced enum is considered as "^isModel" and "^isPrimitiveType", so we have to add a third case : an enum that is neither a model nor a primitive type.
Although maybe it should be considered as a model, and that this causes the bug, but I'm not enough familiar with those definitions to be sure.
The text was updated successfully, but these errors were encountered: