API Design · Middle · Question 64 of 75

Why should API responses avoid exposing nulls for fields that are 'not applicable' vs 'unknown' without documentation?

Explanation

Decide whether absent and null differ, and document it, especially for PATCH semantics.

Further reading

Problem with a question

API Design · Middle · question 64

Test yourself

Take the API Design · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz