Closed ddiyteam closed 3 years ago
Describe the bug Wrong sorting when generating enums
To Reproduce gengen ver. 1.0.0-rc.0 openapi.json - openapi v3 version file
Run gengen g --all --file openapi.json --output ./src/generated
gengen g --all --file openapi.json --output ./src/generated
enum config from openapi v3 json file
.... "EntityStatus": { "enum": [ 0, 1, 2, 3, -2, -1 ], "type": "integer", "format": "int32", "x-enumNames": [ "Candidate", "Active", "OnProbationPeriod", "OnTermination", "Canceled", "Terminated" ] }, ...
Actual output Result:
export enum EntityStatus { Candidate = -1, Active = -2, OnProbationPeriod = 0, OnTermination = 1, Canceled = 2, Terminated = 3 }
Expected behavior Expected output Result:
export enum EntityStatus { Candidate = 0, Active = 1, OnProbationPeriod = 2, OnTermination = 3, Canceled = -2, Terminated = -1 }
Describe the bug Wrong sorting when generating enums
To Reproduce gengen ver. 1.0.0-rc.0 openapi.json - openapi v3 version file
Run
gengen g --all --file openapi.json --output ./src/generated
enum config from openapi v3 json file
Actual output Result:
Expected behavior Expected output Result: