Bird
0
0

Identify the error in this hierarchical REST API path: /projects//tasks/7

medium📝 Debug Q14 of 15
Rest API - URL and Resource Design
Identify the error in this hierarchical REST API path: /projects//tasks/7
AMissing task ID before 7
BDouble slash between 'projects' and 'tasks' is invalid
CResource names should be capitalized
DThe path should end with a slash
Step-by-Step Solution
Solution:
  1. Step 1: Check the path syntax

    The path has two slashes '//' between 'projects' and 'tasks', which is not valid in REST API paths.
  2. Step 2: Understand correct path format

    Only one slash should separate resource names and IDs to maintain proper hierarchy.
  3. Final Answer:

    Double slash between 'projects' and 'tasks' is invalid -> Option B
  4. Quick Check:

    Only single slashes separate path segments [OK]
Quick Trick: Check for extra or missing slashes in paths [OK]
Common Mistakes:
  • Ignoring double slashes as harmless
  • Thinking resource names must be capitalized
  • Believing trailing slash is mandatory

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes