API Design · Middle · Question 56 of 75
What's a sensible default for unknown query parameters?
- 1Treat them as filters on any field
- 2Pass them straight into the database query
- ✓Correct answer: Reject them with 400 (or at least document that they're ignored), so typos like
?limt=10don't silently do nothing
Explanation
Silent ignoring hides client bugs. Many guidelines prefer strict validation.