Skip to content

Roshankumar350/APIContractCompatability

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 Purpose

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.

Why this matters

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.

Repositories

Client- Server Communication

iOS client communicates with the server using versioned endpoints. Client-Server

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

About

A project showcasing API versioning contracts with unified user models.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published