惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
美团技术团队
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
Jina AI
Jina AI
博客园_首页
M
MIT News - Artificial intelligence
D
DataBreaches.Net
L
LangChain Blog
宝玉的分享
宝玉的分享
F
Fortinet All Blogs
A
About on SuperTechFans
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
Y
Y Combinator Blog
腾讯CDC
Vercel News
Vercel News
雷峰网
雷峰网
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
API Contract Testing: Why Safe Changes Still Break Clients
Taras H · 2026-05-09 · via DEV Community
Cover image for API Contract Testing: Why Safe Changes Still Break Clients

Taras H

APIs often break clients in ways that don’t show up in tests.

A change looks safe inside the service:

  • remove an unused field
  • tighten validation
  • adjust an error response

Everything still works locally. Tests pass. Deployment succeeds.

Then a mobile app crashes.

A partner integration fails.

An older frontend silently breaks.

Nothing is “wrong” in the service - but the contract changed.


The Problem: Internal Changes, External Breakage

Consider a response:

{
  "id": "ord_123",
  "status": "paid",
  "customer": {
    "id": "cus_456",
    "email": "ada@example.com"
  }
}

Enter fullscreen mode Exit fullscreen mode

Removing customer.email looks like cleanup.

But for a client, that field might:

  • power a receipt screen
  • feed an export pipeline
  • be required in a generated SDK

From the server’s perspective: harmless

From the client’s perspective: breaking change


Why This Keeps Happening

Most tests focus on correctness inside the service:

  • business logic
  • database state
  • request handling

They don’t protect what clients depend on.

That gap is where breakage happens.


What Contract Testing Actually Protects

Contract testing focuses on the boundary between services and clients.

It answers:

“Did we change what clients rely on?”

Typical breaking changes:

  • removing or renaming fields
  • changing types
  • adding required inputs
  • changing error formats

Non-breaking (usually):

  • adding optional fields

Why Schema Alone Isn’t Enough

Schema diffs (like OpenAPI) catch structure.

But real systems depend on behavior:

  • error codes
  • pagination shape
  • idempotency responses

Those require examples, not just schemas.


The Key Insight

Most API breakages aren’t failures of code - they’re failures of assumptions at the boundary.

Contract testing makes those assumptions visible before release.


Final Thought

Small internal changes can quietly break external systems.

Contract testing turns that from a surprise into a decision.

👉 Full deep dive: https://codenotes.tech/blog/api-contract-testing-prevent-breaking-clients-before-release