This repository demonstrates API contract compatibility between a Node.js backend and an iOS client.
- Backend (
user-api) β Implements versioned endpoints (/v1/users,/v2/users) with different response contracts. - Client (
user-iOS) β Consumes the API and shows how contract changes affect decoding and behavior.
API contracts define the shape of data exchanged between server and client.
When contracts evolve (e.g., adding/removing fields, changing structure), clients must adapt.
This demo highlights:
- How versioned APIs prevent breaking changes.
- How Swift models (
UserV1,UserV2) map to different contracts. - How async/await networking handles responses gracefully.
iOS client communicates with the server using versioned endpoints.

The iOS Client sends two requests:
- GET /v1/users β expects { firstName, lastName }
- GET /v2/users β expects { fullName }
The Server responds with versioned contracts:
- API v1 returns separate fields
- API v2 returns a combined field