ferdikoomen / openapi-typescript-codegen

NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification
MIT License
2.79k stars 513 forks source link

Missing fields on enum #2184

Open brunokrebs opened 4 weeks ago

mrlubos commented 4 weeks ago

@brunokrebs would you like to provide context?

brunokrebs commented 4 weeks ago

Hi, @mrlubos, sorry, ended up opening to see if CI would run, but it didn't.

Anyway, before realizing that this repo is no longer maintained, I cloned it into my computer, added a test case, and generated the snapshot that shows what I was going to report.

As you can see, if we have an enum with keys like +name and -name, and +total and -total, the library ends up ignoring the "opposite" key (of whatever comes first, + or -).

so, on the snapshot, we ended up with:

export enum EnumWithStringsWithPlusAndMinusSigns {
    _NAME = '+name',
    _TOTAL = '+total',
}

Instead of a type with four keys.

mrlubos commented 4 weeks ago

@brunokrebs you got it with the deprecation notice. Feel free to open an issue in Hey API if this isn't fixed there yet.