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
Is your feature request related to a problem? Please describe.
While the typescript interfaces generated for the model can be fully compatible with client side models, this is not the case with enums as different string enums cannot be compatible on the client side. Typescript enums are problematic, and the typescript community has a better solution.
Implemented this would allow the client side models and server side models to be entirely decoupled, as enums are the only thing standing in the way of that at the moment.
I realize that many people likely use the server models directly, but a flexible approach would be preferable.
Describe the solution you'd like
The typescript-angular and typescript-axios generator actually already implements this by default (stringEnums = false).
StefanKern
changed the title
[typescript-angular] stringEnums should behave the same as other implementions
[typescript-angular] Allow string literal unions instead of string enums
Jun 28, 2022
What is the issue here? The typescript-angular generator already supports this, the option stringEnums is false by default, which generates the enum in the form of a union type and an accompanied object with the string literals.
simon-abbott
added a commit
to simon-abbott/openapi-generator
that referenced
this issue
Aug 21, 2024
--> This title and description is a copy of [REQ][typescript-fetch] Allow string literal unions instead of string enums, which already describes it perfectly and also applies this typescript generator.
Addition:
current output of option
stringEnum
The text was updated successfully, but these errors were encountered: