Recall & Review
beginner
What is API versioning?
API versioning is the practice of managing changes in an API by assigning version numbers. It helps clients know which version they are using and ensures backward compatibility.
Click to reveal answer
beginner
Name two common ways to include version information in a REST API.
1. In the URL path (e.g., /v1/users)<br>2. In the HTTP header (e.g., Accept: application/vnd.example.v1+json)
Click to reveal answer
intermediate
Why is semantic versioning important in API versioning?
Semantic versioning uses a format like MAJOR.MINOR.PATCH to communicate the type of changes: major for breaking changes, minor for new features without breaking, and patch for fixes. This helps clients understand impact before upgrading.
Click to reveal answer
intermediate
What is a backward-compatible change in API versioning?
A backward-compatible change means the new API version does not break existing clients. Examples include adding new optional fields or endpoints without removing or changing existing ones.
Click to reveal answer
beginner
Why should you avoid breaking changes in minor or patch versions?
Breaking changes can cause existing clients to fail. Minor and patch versions should only add features or fix bugs without breaking compatibility to keep clients working smoothly.
Click to reveal answer
Which of the following is a common way to specify API version?
✗ Incorrect
API versions are often included in the URL path to clearly indicate which version the client is using.
What does a major version change usually indicate?
✗ Incorrect
Major version changes signal breaking changes that might require clients to update their code.
Which header is commonly used to specify API version?
✗ Incorrect
The Accept header can specify the desired API version using media type versioning.
What should you do if you want to add a new optional field to an API response?
✗ Incorrect
Adding new optional fields is a backward-compatible feature and fits a minor version increase.
Why is it important to keep old API versions available for some time?
✗ Incorrect
Maintaining old versions lets clients upgrade when ready, avoiding sudden breaks.
Explain the main strategies for versioning a REST API and when to use each.
Think about how clients specify which API version they want.
You got /4 concepts.
Describe semantic versioning and why it matters for API versioning.
Consider how version numbers communicate change types.
You got /3 concepts.