Is the API Schema Coherent Across the System?¶
Type: Structure
Category: API
Audience: Backend engineers, API designers, frontend integrators
đ What This Perspective Asks¶
- Are schemas consistent across endpoints and services?
- Do field names and nesting follow clear rules?
- Can clients rely on structureâor must they guess each time?
This isnât about correctness. Itâs about legibility and trust.
â ď¸ Common Anti-Patterns¶
- Same concept â different names on different endpoints
- Inconsistent casing, nesting, nullability defaults
- Error formats differ per service
- Schema evolution breaks old clients due to lack of compatibility design
â Healthier Schema Design¶
- Enforce global schema conventions (naming, nesting, status codes)
- Use shared schema libraries or contract tooling (e.g. OpenAPI, Protobuf)
- Explicitly version schemasâeven internally
- Separate transport schema (API) from domain model (logic layer)
- Validate schema diffs in CI with backward compatibility checks
đ§ Principle¶
Schema is not documentation.
Schema is contracted behaviorâand must be designed as such.
â FAQ¶
-
Q: Can we evolve schemas without breaking clients?
A: Only if you design versioning and fallback into the contract. -
Q: Isnât schema just data shape?
A: No. Itâs a long-term interface between independent actors.