-
Notifications
You must be signed in to change notification settings - Fork 118
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
SchemaFactory trigger an error when a schema doesn't have the @Schema decorator #1697
Closed
1 task done
Labels
Comments
Would you like to create a PR for this issue? |
I really want to help, but I've never made a contribution to the Nest project. Do you think this issue would be a good starting point? I don't know what size it can be. @kamilmysliwiec |
I think this one should be fairly simple so if you have some time, feel free to give it a shot :) |
I will try! |
This was referenced Mar 11, 2023
@kamilmysliwiec Hi, I opened the PR! |
Let's track this here #1703 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
Instead of declaring my
@Schema
decorator in the class that I passed toSchemaFactory.createForClass
, I accidentally declared this decorator in another class in my file. Although it was my mistake, I believe that if there had been a error exposed I would have had greater visibility into what I did wrong.Until I realized that this
@Schema
was out of place, I couldn't useupdateOne
, although I was able to usefindOne
.Describe the solution you'd like
Trigger an error if my schema is not successful.
Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
As mentioned, I spent quite some time looking for solutions related to Mongoose or MongoDB, only to realize that the issue was simply a declaration error in the schema. I understand that it was my mistake, however, this can help people avoid going through the same debugging process if they accidentally have a wrong declaration in the schema.
The text was updated successfully, but these errors were encountered: