Subissue of EPIC #1938 — REST API Contract-First Migration
Problem
During the contract-first migration (SI-1 through SI-5), production code was moved from axum-rest-api-server to the new layered packages (rest-api-protocol, rest-api-application, rest-api-runtime-adapter). However, two issues remain:
-
Tests left in wrong package: The file axum-rest-api-server/src/v1/context/torrent/resources/torrent.rs contains unit tests for conversion functions that now live in rest-api-runtime-adapter::conversion. These tests should be moved alongside their production code.
-
Inconsistent v1 namespace: Packages rest-api-application and rest-api-runtime-adapter expose their modules at the top level, while rest-api-protocol, axum-rest-api-server, and rest-api-client use a v1/ module. The two outlier packages should be aligned.
Scope
Part A: Move misplaced tests
- Move conversion tests from
axum-rest-api-server/src/v1/context/torrent/resources/torrent.rs to rest-api-runtime-adapter::conversion.
- Remove empty stub
axum-rest-api-server/src/v1/context/torrent/resources/peer.rs and its module declaration.
Part B: Align v1 namespace
- Add
v1/ module to rest-api-application and move ports/ and use_cases/ under it.
- Add
v1/ module to rest-api-runtime-adapter and move adapters/, container.rs, conversion.rs under it.
- Update all internal imports across the workspace.
Checklist
Subissue of EPIC #1938 — REST API Contract-First Migration
Problem
During the contract-first migration (SI-1 through SI-5), production code was moved from
axum-rest-api-serverto the new layered packages (rest-api-protocol,rest-api-application,rest-api-runtime-adapter). However, two issues remain:Tests left in wrong package: The file
axum-rest-api-server/src/v1/context/torrent/resources/torrent.rscontains unit tests for conversion functions that now live inrest-api-runtime-adapter::conversion. These tests should be moved alongside their production code.Inconsistent
v1namespace: Packagesrest-api-applicationandrest-api-runtime-adapterexpose their modules at the top level, whilerest-api-protocol,axum-rest-api-server, andrest-api-clientuse av1/module. The two outlier packages should be aligned.Scope
Part A: Move misplaced tests
axum-rest-api-server/src/v1/context/torrent/resources/torrent.rstorest-api-runtime-adapter::conversion.axum-rest-api-server/src/v1/context/torrent/resources/peer.rsand its module declaration.Part B: Align v1 namespace
v1/module torest-api-applicationand moveports/anduse_cases/under it.v1/module torest-api-runtime-adapterand moveadapters/,container.rs,conversion.rsunder it.Checklist
rest-api-runtime-adapterpeer.rsstub removedrest-api-applicationhasv1/module with ports + use-casesrest-api-runtime-adapterhasv1/module with adapters + container + conversion