• Olatunde Success portraitOlatunde Success
  • Date:  28 May 2026
  • API Design

API Contracts and Schema Validation: How to Stop Shipping Breaking Changes

Olatunde Success explains the API contract discipline he introduced at Jobfactor and uses across SAW Technologies: schema validation at the boundary, contract checks in CI, and versioning rules that let frontend and backend teams ship independently.

The most expensive bugs I have seen in production were not clever. They were a renamed field, a number that became a string, an optional property that quietly became required. Breaking changes ship because nothing stands between a backend refactor and the mobile app that depends on it. At Jobfactor I introduced API contracts with automated schema checks to close that gap, and the pattern now runs through everything we build at SAW Technologies.

The contract is a schema, not a document

A wiki page describing your API is fiction within a month. A contract only works if it is executable: a schema that validates requests and responses at runtime and can be diffed in CI. In our NestJS services every DTO is defined once with class-validator decorators, and the OpenAPI document generated from those definitions is committed to the repository. That file is the contract, and git tracks every change to it.

CI is where contracts grow teeth
  • A pipeline step regenerates the OpenAPI document and diffs it against the committed one. An uncommitted API change fails the build before review even starts.

  • A breaking-change detector classifies the diff: removed fields, narrowed types, and new required inputs block the merge without an explicit version bump.

  • Consumers pin to the contract version, so a mobile release knows exactly which API surface it was tested against.

Runtime validation completes the loop

Contracts in CI stop known changes; runtime validation catches everything else. Inbound payloads are rejected at the boundary with precise errors, and unexpected fields in third-party webhook payloads get logged the moment a provider changes shape under us. In fintech that has a second job: input validation at the edge is a security control, not just a correctness one.

None of this slows a team down. It replaces the slowest process in software, which is two teams debugging a production incident across a boundary neither of them can see. The contract makes the boundary visible. Everything after that is just engineering.

More from the blog

Want to talk about this article or a project?

© 2026 Olatunde Success. All rights reserved.

Built in Ibadan, Nigeria

background