API Design · Junior · Question 63 of 75
Why are enums in API responses tricky to extend?
- 1Enums are always strings in HTTP
- 2Enums can't be sent in JSON
- ✓Correct answer: Clients may crash on unknown values; document that new values can appear and make clients handle unknowns
Explanation
Adding an enum value can be a breaking change for strict clients. Some guidelines treat output enums as extensible by default.