Skip to content

DefaultBodyModelValidator extensibility #9

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

Closed
Eilon opened this issue Jul 23, 2016 · 2 comments
Closed

DefaultBodyModelValidator extensibility #9

Eilon opened this issue Jul 23, 2016 · 2 comments

Comments

@Eilon
Copy link
Member

Eilon commented Jul 23, 2016

Original PR: https://aspnetwebstack.codeplex.com/SourceControl/network/forks/abatishchev/modelvalidation2/contribution/8644


Opening DefaultBodyModelValidator for changes via inheritance and overriding of its private (now protected virtual) method.

As described in the following issue for Fluent Validation Web API integration package FluentValidation/FluentValidation#178 (comment), FV makes small changes in DFMV but has to copy-paste the whole class as-is because it's barely extendable having all method as private.

This pull request changes them to protected virtual with minimal related changes (few nested private methods should be now protected, one internal interface - public).

Please review!

MPSIT Engineering extensively uses ASP.NET Web API for current and new projects, and relies on Fluent Validation to validate input. But unfortunately we're unable to change some of the behaviors without copy-pasting huge pieces of code, what would be perfectly avoidable with the proposed change.

Thanks,
Alex

@Eilon Eilon added this to the 5.2.4 milestone Jul 23, 2016
@Eilon
Copy link
Member Author

Eilon commented Oct 4, 2017

We should clean up the original PR a bit - we don't want public (incl. protected) nested types for this.

dougbu added a commit that referenced this issue Oct 27, 2017
- #9
- add `BodyModelValidatorContext` and `IBodyModelValidatorKeyBuilder`
dougbu added a commit that referenced this issue Oct 31, 2017
- #9
- add `BodyModelValidatorContext` and `IBodyModelValidatorKeyBuilder`
@dougbu
Copy link
Member

dougbu commented Oct 31, 2017

eebbf38

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