Bird
0
0

A developer sends this Problem Details JSON:

medium📝 Debug Q7 of 15
Rest API - Error Handling
A developer sends this Problem Details JSON:
{"type": "not-a-valid-uri", "title": "Error", "status": 400}

What is the issue with this response?
AThe <code>status</code> field must be a string
BThe <code>type</code> field must be a valid URI reference
CThe <code>title</code> field is too short
DThe JSON is missing the <code>instance</code> field
Step-by-Step Solution
Solution:
  1. Step 1: Validate the type field format

    The type field must be a valid URI reference, but "not-a-valid-uri" is not a valid URI.
  2. Step 2: Check other fields

    title can be any string, status must be an integer (which it is), and instance is optional.
  3. Final Answer:

    type must be a valid URI reference -> Option B
  4. Quick Check:

    type = valid URI [OK]
Quick Trick: type must always be a valid URI [OK]
Common Mistakes:
  • Using plain text instead of URI for type
  • Thinking instance is mandatory
  • Confusing status type

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes