Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum conversion #1722

Closed
2 of 4 tasks
fiftyy opened this issue Nov 24, 2024 · 2 comments
Closed
2 of 4 tasks

Enum conversion #1722

fiftyy opened this issue Nov 24, 2024 · 2 comments

Comments

@fiftyy
Copy link

fiftyy commented Nov 24, 2024

Sorting

  • I'm submitting a ...

    • bug report
    • feature request
    • support request
  • I confirm that I

    • used the search to make sure that a similar issue hasn't already been submit

Current Behavior

"ServerTier":{
   "enum":[
      0,
      1
   ],
   "type":"number"
},
export enum ServerTier {
  DEFAULT,
  PREMIUM
}

Context (Environment)

Version of the library:
Version of NodeJS:

  • Confirm you were using yarn not npm: [ ]

Detailed Description

Hi, currently i try to use this enum and i build my api with swagger-typescript-api
and i get this as output:

export enum ServerTier {
	Value0 = 0,
	Value1 = 1
}

And now when i compare/work with the enum/api i get this:
Type 'ServerTier.PREMIUM' is not assignable to type 'ServerTier'.ts(2322)

Maybe their is away to declare the enum names into the open api spec

Maybe this issue doesnt belongs to tsoa but i tough because of the swagger.json generation.
Remind me if im wrong, apologies in advance...

Breaking change?

Copy link

Hello there fiftyy 👋

Thank you for opening your very first issue in this project.

We will try to get back to you as soon as we can.👀

@fiftyy
Copy link
Author

fiftyy commented Nov 24, 2024

@fiftyy fiftyy closed this as completed Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant