World 1 / Quest 1.6

ADR-001: Layers and Versioning Stance

Commit the API versioning decision before future endpoints multiply.

Concept

A versioning stance is an operating decision, not a routing decoration. This course chooses /api/v1 because it is explicit, easy to test, and clear to consumers.

Task

  1. Move every public endpoint under /api/v1.
  2. Write ADR-001 with the layer boundaries and versioning stance.
  3. Add a test that fails if the cinema endpoint is exposed without /api/v1.

Run

./gradlew test --tests "*CinemaApiVersioningTest"

Expected Result

  • GET /api/v1/cinemas succeeds.
  • GET /cinemas does not become an accidental public contract.

Common Traps

  • Writing an ADR that says what happened but not why.
  • Treating Spring Framework 7 native API versioning as a reason to complicate this repo now.
  • Versioning only some endpoints.

Hint Ladder

Hint 1

The ADR should be short enough to read during review.

Hint 2

Mention the Framework 7 API versioning feature as an aside, not an implementation dependency.

Hint 3

The route prefix is part of the public contract. Test it like one.

Solution

Reference solution will link to ADR-001 once the learner repo is public.

Boot 3 to 4 Delta

Spring Framework 7 has native API versioning support. This course records it as currency knowledge while keeping the implementation URI-based.