API Design · Junior · Question 62 of 75
How should boolean flags be named in API payloads?
- 1With single letters to save space
- ✓Correct answer: Clearly and positively, e.g.
isActiveoremailVerified, avoiding double negatives likenotDisabled - 3As strings
"yes"/"no"
Explanation
Consider enums instead of booleans when more states may appear later (status: "active" | "suspended").