When sending a JSON payload, sometimes it's important to know whether a null value was sent, especially for a PATCH type operation. The struct that I decode to will obviously have that as a nullable type. However, I can't see any way to know whether it's nil because the JSON contained the key with a null value, or whether it's nil because the JSON just didn't send that key. How do you handle this?
JSONDecoder...was a null value present?
Have a look here:
https://stackoverflow.com/questions/29264449/how-to-check-if-json-is-null-in-swift
Test against all possible keys of the struct itself.