- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 158
JADNC: Required Input validation disabled for partial patching / relationships #781
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: Required Input validation disabled for partial patching / relationships #781
Conversation
FYI. Integration / unit tests succeed locally, but for some reason are failing according to the "AppVeyor build." Will investigate. |
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.
This looks great! I agree this new approach is an improvement over what you submitted before. Thanks.
src/JsonApiDotNetCore/Models/CustomValidators/RequiredIfEnabled.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Models/CustomValidators/RequiredIfEnabled.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Models/CustomValidators/RequiredIfEnabled.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Serialization/Common/BaseDocumentParser.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Serialization/Common/BaseDocumentParser.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Serialization/Common/BaseDocumentParser.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Serialization/Common/BaseDocumentParser.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Models/CustomValidators/RequiredIfEnabled.cs
Outdated
Show resolved
Hide resolved
test/JsonApiDotNetCoreExampleTests/Acceptance/ResourceDefinitions/ResourceDefinitionTests.cs
Outdated
Show resolved
Hide resolved
The cibuild failure is likely unrelated to your work. Some tests are still not properly isolated, which makes them fail occasionally (tracked at #715). Usually pushing another empty commit makes the build succeed. |
-HttpContextAccessor injection -Renaming -Moved HttpContext Keys to extensions
src/JsonApiDotNetCore/Serialization/Common/BaseDocumentParser.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Serialization/Common/BaseDocumentParser.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Serialization/Common/BaseDocumentParser.cs
Outdated
Show resolved
Hide resolved
test/JsonApiDotNetCoreExampleTests/Acceptance/ManyToManyTests.cs
Outdated
Show resolved
Hide resolved
-mock httpContextAccessor -remove duplicated code -add documentation
Please merge the latest master into your branch and see if all still works before we take this PR. |
src/JsonApiDotNetCore/Models/CustomValidators/IsRequiredAttribute.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Models/CustomValidators/IsRequiredAttribute.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Models/CustomValidators/IsRequiredAttribute.cs
Outdated
Show resolved
Hide resolved
test/JsonApiDotNetCoreExampleTests/Acceptance/ResourceDefinitions/ResourceDefinitionTests.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore/Serialization/Server/RequestDeserializer.cs
Outdated
Show resolved
Hide resolved
-Move integration tests to ModelStateValidationTests -formatting -documentation -comments
Bart, I pulled the latest master, but then thought since this is my fork, it may not actually be pulling the JADNC master. I am not familiar with "forking" and am unsure how to merge JADNC master into my fork. I have made the other changes you requested. Thank you for all the great feedback. |
git fetch upstream
git checkout yourbranch
git merge upstream/master
In the same way you can sync your forked master branch. Hope this helps.
|
…disable_validators
docs/usage/options.md
Outdated
|
||
```c# | ||
public class Person : Identifiable<int> |
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.
This can inherit from the non-generic Identifiable, which is easier to understand for newcomers (see my example). Also this is a nice opportunity to show usage of the AllowEmptyStrings parameter so users will know it exists. Can you use my example from earlier comments instead?
Never mind, I'll change this.
Thanks a lot, Sarah! |
Fixes #472
This feature allows the Required validator to be disabled. This will allow partial patching in the case that the attribute is excluded from a patch. Validation is applied when the attribute is present in post or patch.
Required validation also disabled for a relationships attributes (in attempt to fix #472 (comment)).