by yen223 · 2y ago · 0 comments
{"name": null, "age": 25} // Set name to null, and age to 25
from {"age": 25} // Only set age to 25, leave name alone
In the former, "name" has value `null`; in the latter, the "name" field has value `undefined`Most strongly-typed mainstream backend languages don't make this distinction between "a field having value null" and "a field not being present", and this results in those languages parsing both payloads as the same. This makes API design much harder than it needs to be.