Bird
0
0

A REST API returns inconsistent field names for user email: sometimes "email", sometimes "userEmail". What is the main issue this causes?

medium📝 Debug Q6 of 15
Rest API - Request and Response Format
A REST API returns inconsistent field names for user email: sometimes "email", sometimes "userEmail". What is the main issue this causes?
AServer will reject requests with inconsistent fields
BClient code must handle multiple field names, increasing complexity
CClients will automatically correct field names
DAPI documentation becomes unnecessary
Step-by-Step Solution
Solution:
  1. Step 1: Identify inconsistency in field naming

    Different field names for the same data confuse client code.
  2. Step 2: Understand client impact

    Clients must write extra code to check for both field names, increasing complexity and risk of bugs.
  3. Final Answer:

    Client code must handle multiple field names, increasing complexity -> Option B
  4. Quick Check:

    Inconsistent fields = complex client code [OK]
Quick Trick: Use consistent field names to avoid client confusion [OK]
Common Mistakes:
  • Assuming server rejects inconsistent fields automatically
  • Believing clients fix field names without code
  • Thinking documentation is not needed with inconsistent fields

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes