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

Enums with enumName field and additional fields generate non-functional swagger file #2806

Closed
3 of 4 tasks
Algram opened this issue Jan 30, 2024 · 3 comments
Closed
3 of 4 tasks

Comments

@Algram
Copy link
Contributor

Algram commented Jan 30, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

If you have a look at my gist, I added additional fields like deprecated or description to an enum that also has enumName.
In this case, the resulting swagger file is not really functional since as per swagger specification, siblings to refs get ignored completely: https://swagger.io/docs/specification/using-ref/#sibling

Since there is no way to use decorators with enums, it is currently impossible to be swagger-spec compliant. I think the generation would have to move the additional fields to the referenced enum instead of keeping it in place.

Minimum reproduction code

https://gist.github.com/Algram/5e95133afd8750bd4f936cd846f51639

Steps to reproduce

No response

Expected behavior

The additional fields are part of the referenced enum.

Package version

7.2.0

NestJS version

10.3.1

Node.js version

No response

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@kamilmysliwiec
Copy link
Member

Would you like to create a PR for this issue?

@Algram
Copy link
Contributor Author

Algram commented Feb 2, 2024

@kamilmysliwiec Sure, I've opened one here: #2816

@kamilmysliwiec
Copy link
Member

Let's track this here #2816

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants