Bird
0
0

You have an API with versioning: /api/v1/users and /api/v2/users. You accidentally remove a field in v2 that clients still use in v1. What is the best fix?

medium📝 Debug Q14 of 15
Rest API - Versioning Strategies
You have an API with versioning: /api/v1/users and /api/v2/users. You accidentally remove a field in v2 that clients still use in v1. What is the best fix?
AKeep the field in v1 and remove only in v2 to avoid breaking v1 clients.
BRemove the field from both versions immediately.
CRemove the field from v1 and v2 but notify clients to update.
DMerge v1 and v2 into a single version without the field.
Step-by-Step Solution
Solution:
  1. Step 1: Understand versioning purpose

    Versioning allows old clients to keep using old API features safely.
  2. Step 2: Apply versioning to field removal

    Removing a field only in v2 keeps v1 stable for clients still using it.
  3. Final Answer:

    Keep the field in v1 and remove only in v2 to avoid breaking v1 clients. -> Option A
  4. Quick Check:

    Remove features only in new versions = A [OK]
Quick Trick: Remove features only in new versions, keep old stable [OK]
Common Mistakes:
  • Removing fields from all versions at once
  • Merging versions and breaking old clients
  • Ignoring impact on old clients

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes