API Testing · Junior · Question 58 of 75
What should happen when an API receives an unknown field in a request body?
- 1It should save the field in a new database column
- 2It should always crash so that the client notices
- 3It follows its documented rule, ignore or reject
Show the answer
Correct answer: It follows its documented rule, ignore or reject
Explanation
Some APIs reject unknown fields to catch typos; others ignore them for compatibility. Either way, behaviour should be documented and consistent.