joukevandermaas / saule

JSON API library for ASP.Net Web API 2.
https://joukevandermaas.github.io/saule
MIT License
76 stars 37 forks source link

Update of a resource with non nullable fields #195

Closed PhyberApex closed 6 years ago

PhyberApex commented 6 years ago

So far if a attribute is not set in the JSON deserilized by saule it gets either set to null (for nullable attributes) or set to a initial value (like 0 for a non-nullable int). Is there any way to tell if a PATCH request is incomming to differ a actual sent 0 from a assumed 0?

~Cheers

joukevandermaas commented 6 years ago

This is the same behavior as Web API without Saule. I'm hesitant to add solutions to problems not related to JSON API to Saule.

Perhaps this answer on stack overflow can help you? Note that you can add your own JsonConverters to the JsonApiConfiguration during setup.

PhyberApex commented 6 years ago

Hey,

thanks for your quick reply and that link. As this is a general "issue" with the Web API I'm gonna close this here and will try to look into the solution you linked me.

~Cheers