-
Notifications
You must be signed in to change notification settings - Fork 57
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
Validation layer #61
Comments
This is a bit of a step into creating our own DSL to generate APIs, and I would like to decline this. Data Annotation validation should be supported by default by Minimal APIs, and inherited by InstantAPIs downstream If a developer needs significant validation and error checking in their APIs, they can write that API directly. |
This is a bit awkward though as the more I think about it, the less I think validation attributes belong in domain models. They are better suited at a dto level so it would be nice if anyone has any suggestions for how they think this could be done. For me it boils down to the fact that most endpoints will have some form of validation, so if I have to hand crank all of those, where is the benefit here? |
Why would you not just use Fluent Validation seems like this would be recreating what is already available in the excellent package. |
It would be nice if this whole process could be like a pluggable pipeline (kind of like middleware) where I can just slot in additional functionality. So initial example would just be to add a fluent validator based on each db model and use attributes like [Required] or [MaxLength(500)] to hint to the validation rules that will apply for that object.
The text was updated successfully, but these errors were encountered: