Bird
0
0

Given this validation error response:

medium📝 Predict Output Q4 of 15
Rest API - Error Handling
Given this validation error response:
{"errors": {"password": "Too short", "age": "Must be a number"}}

What will the client see as the error message for the 'age' field?
AToo short
BField is required
CMust be a number
DInvalid input
Step-by-Step Solution
Solution:
  1. Step 1: Locate 'age' key in errors object

    The JSON shows 'age' key with value "Must be a number".
  2. Step 2: Identify the message for 'age'

    The client will see the exact string "Must be a number" as the error message.
  3. Final Answer:

    Must be a number -> Option C
  4. Quick Check:

    Error message for 'age' = Must be a number [OK]
Quick Trick: Match field name to error message in JSON [OK]
Common Mistakes:
  • Confusing messages between fields
  • Assuming default messages instead of given ones
  • Ignoring the exact error text

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes