- S&F Datentechnik
- SnapDevelop
- Monday, 5 December 2022 02:02 PM UTC
Hi,
I'm wondering how to handle update requests in my API, where the request does not necessarily include all the properties that the API is able to update.
The API might be able to receive a DTO with 10 properties, but if your JSON only contains 5 of those, the remaining ones will be considered null.
This might lead to null being written into the database, even though the property wasn't actually present in the request and not supposed to be changed at all.
Generally though, actually passing a property with null as its value is absolutely fine and should be updated accordingly.
So the main question is, how to differentiate between null values and not present values?
Regards,
Chris
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.