-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Breaks swagger plugin #188
Comments
@lepicekmichal please provide your code to reproduce the issue |
@hasezoey no need, just turn it on. |
@lepicekmichal i dont know what you mean with "just turn it on" i never used nest outside of typegoose debugging and never swagger - so please provide steps to for me to reproduce the issue |
Alright, but then it's too much code to share. Just create simplest app in nestjs (nest can generate it) and use typegoose in it. |
@lepicekmichal just create an reproduction repository - with instructions how to start and where to look for the error |
closing because no further information was given and is stale since February |
Hi, I know the issue is closed, but if you stumble upon this post while googling the issue, I have managed to reproduce the issue with following packages
The issue goes as following: both NestJs swagger and typegoose use Reflect.getMetadata in order to get the data about your classes, but when you import some typegoose functions that use Reflect the object gets redefined in global scope and method works differently. Kinda sloppy explanation, but this is what I found out during my nightly monkey patching session. Fix: bump your reflect-metadata package, it somehow fixes it |
@Bratishques the problem is that also please note that currently |
Thanks for the explanation, I personally hate when something decides to go global, stuff just breaks. I guess you understood it, but I will clarify: when I said bump your reflect-metadata package, it somehow fixes it I meant that the person that is googling the issue will resolve by doing so, typegoose itself causes no issue. And thanks for your hard work maintaining the package! |
Versions
What is the Problem?
When I use typegoose, it breaks swagger plugin for automatic generation of documentation.
https://trilon.io/blog/nestjs-swagger-4-whats-new#Introducing-the-NEW-Nest-Swagger-Plugin-
https://github.com/nestjs/swagger/tree/master/lib/plugin
nest-cli.json
any.dto.json
Do you know why it happenes?
no
The text was updated successfully, but these errors were encountered: