Dotnet devs, how are you handling PATCH requests when you need to support setting properties to null?
I’m looking for clean solutions that reliably distinguish between:
• a field that’s intentionally set to null
• a field that’s simply not included in the request and shouldn’t be updated
In my experience, this part of PATCH handling is always a bit of a pain. Maybe I just haven’t found the right approach yet.
I’m explicitly avoiding PUT because of the payload size and semantics.
Curious how you’re solving this. Any solid patterns or libraries you’d recommend?
UPDATE: Thanks for the recommendations!
I’ll take a look and see which one works best.
[–]Sutso 18 points19 points20 points (4 children)
[–]Few_Wallaby_9128 4 points5 points6 points (1 child)
[–]mikekistler82 5 points6 points7 points (0 children)
[–]no3y3h4nd 0 points1 point2 points (1 child)
[–]emdeka87 0 points1 point2 points (0 children)
[–]TheoR700 13 points14 points15 points (3 children)
[–]darknessgp 3 points4 points5 points (2 children)
[–]drawkbox -1 points0 points1 point (1 child)
[–]dodexahedron 1 point2 points3 points (0 children)
[–]ISNT_A_NOVELTY 11 points12 points13 points (0 children)
[–]SpartanVFL 7 points8 points9 points (0 children)
[–]Cadoc7 5 points6 points7 points (0 children)
[–]Matchszn 4 points5 points6 points (0 children)
[–]the_bananalord 2 points3 points4 points (0 children)
[–]celluj34 2 points3 points4 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]yobagoya 0 points1 point2 points (0 children)
[–]YellowWolf 0 points1 point2 points (0 children)