Skip to content
Ameen Abozaid
Planned lessonJNR-020-L05

Versioning strategies

  • Lesson 5 of 6
  • Junior
On This Lesson 4 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

compare ways to evolve an API without breaking clients.

Planned topics

  • A breaking change (removing or renaming a field, changing meaning) breaks existing clients.
  • URL versioning: /v1/products. Visible and simple; the most common.
  • Header versioning: a custom header such as X-API-Version: 2. Clean URLs, but harder to test in a browser.
  • Media-type versioning: Accept: application/vnd.shop.v2+json. Precise, but more complex.
  • Adding optional fields is not breaking. Choose one strategy and use it everywhere.
Draft outline details

Demonstration

StrategyExampleTrade-off
URL/v2/productsSimple, visible
HeaderX-API-Version: 2Clean URLs
Media typeAccept: ...v2+jsonPrecise, complex

Check your understanding

Is adding an optional response field a breaking change?

Show answer

No.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.