-
-
Notifications
You must be signed in to change notification settings - Fork 158
JADNC: Add required on post validator. #765
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
JADNC: Add required on post validator. #765
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to my remarks, please add some documentation to docs\usage\resources\attributes.md.
src/JsonApiDotNetCore/Models/CustomValidators/RequiredOnPostAttribute.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Models/CustomValidators/RequiredOnPostAttribute.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Models/CustomValidators/RequiredOnPostAttribute.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Models/CustomValidators/RequiredOnPostAttribute.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Models/CustomValidators/RequiredOnPostAttribute.cs
Outdated
Show resolved
Hide resolved
test/JsonApiDotNetCoreExampleTests/Acceptance/ResourceDefinitions/ResourceDefinitionTests.cs
Outdated
Show resolved
Hide resolved
test/JsonApiDotNetCoreExampleTests/Acceptance/ResourceDefinitions/ResourceDefinitionTests.cs
Show resolved
Hide resolved
test/UnitTests/Serialization/Server/RequestDeserializerTests.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Serialization/Server/RequestDeserializer.cs
Outdated
Show resolved
Hide resolved
Does this PR solve #472 (comment)? |
No, this does not resolve #472 (comment). I have converted back to draft because I want to give another approach a try. I did make the requested changes on this branch though. |
-formatting -add validation error to model state -allow empty strings -documentation
Decided to go another direction, found here: #781 |
Fixes #472
This feature is a custom validator which causes a resource property to be RequiredOnPost, and also validates that the resource property is not updated with a null value on Patch.