openapistack / openapi-client-axios

JavaScript client library for consuming OpenAPI-enabled APIs with axios
https://openapistack.co
MIT License
556 stars 67 forks source link

Enum map support #161

Closed nrl240 closed 1 year ago

nrl240 commented 1 year ago

Hello!

Any plans to incorporate support for generating an enum such as the following?

export enum DailySetting {
    '1:4' = 'Quarter of a day',
    '1:2' = 'Half of a day',
    '3:4' = 'Three quarters of a day',
    '1:1' = 'Full day',
}

I saw openapi-typescript-codegen generate enums with custom names and descriptions, which looks like good inspiration for this package.

anttiviljami commented 1 year ago

I personally prefer union types over enums, and we use a different library to generate the types so switching to enums is probably not something I'd vouch for right now 🙏