Bird
0
0

Which of the following is the correct JSON structure for a minimal Problem Details response?

easy📝 Syntax Q3 of 15
Rest API - Error Handling
Which of the following is the correct JSON structure for a minimal Problem Details response?
A{"type": "https://example.com/probs/out-of-credit", "title": "You do not have enough credit.", "status": 403}
B{"title": "Error", "message": "Invalid input", "code": 400}
C{"error": "Not Found", "status": 404, "detail": "Resource missing"}
D{"type": 404, "title": "Not Found", "status": "error"}
Step-by-Step Solution
Solution:
  1. Step 1: Check required fields and types

    The minimal Problem Details object must have type (URI string), title (string), and status (integer).
  2. Step 2: Validate each option

    {"type": "https://example.com/probs/out-of-credit", "title": "You do not have enough credit.", "status": 403} matches the required fields and types. Options B and C use incorrect field names. {"type": 404, "title": "Not Found", "status": "error"} has wrong types for type and status.
  3. Final Answer:

    Option A is the correct minimal JSON structure -> Option A
  4. Quick Check:

    Minimal Problem Details = correct fields and types [OK]
Quick Trick: Minimal Problem Details needs type, title, status [OK]
Common Mistakes:
  • Using wrong field names like error or message
  • Setting type as a number instead of URI string
  • Confusing status type as string

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes