openapi-tools / swagger-maven-plugin

Maven plugin to activate the Swagger Core library to generate OpenAPI documentation.
MIT License
70 stars 45 forks source link

Field ordering not maintained in generated object descriptions #42

Closed pisajew closed 4 years ago

pisajew commented 4 years ago

Describe the bug On subsequent executions on the same codebase the ordering of attributes is random. This leads to incompatible constructor signatures in generated client code.

To Reproduce

Expected behavior

Additional context Randomizing attribute ordering leads to different constructor signatures for object in generated client code. This requires changes to the source code using generated client every time the client is generated based on regenerated API description.

langecode commented 4 years ago

Thank for reporting. I am pretty sure this is the behaviour of Swagger, not this Maven plugin. The basic idea was to be a thin wrapper around the Swagger framework.

pisajew commented 4 years ago

Agreed, it's either swagger-codegen in general or it's specific swift4 target. Any way this issue doesn't belong here.