<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-api-contract-nobody-owned-zumpulxcf" -->

---
title: The API Contract Nobody Owned | daily.dev
description: A field report walks through a team's year-long evolution from an undocumented, chaos-prone API to a fully API-first workflow. It traces the stages: no spec at...
canonical: https://daily.dev/posts/the-api-contract-nobody-owned-zumpulxcf
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The API Contract Nobody Owned | daily.dev
og:description: A field report walks through a team's year-long evolution from an undocumented, chaos-prone API to a fully API-first workflow. It traces the stages: no spec at...
og:url: https://daily.dev/posts/the-api-contract-nobody-owned-zumpulxcf
og:image: https://api.daily.dev/og/posts/ZUMpulxCF.png
og:image:alt: The API Contract Nobody Owned
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The API Contract Nobody Owned

**[ITNEXT](https://daily.dev/sources/itnext)** · 19 min read · 1 upvotes · 0 comments

## Summary

A field report walks through a team's year-long evolution from an undocumented, chaos-prone API to a fully API-first workflow. It traces the stages: no spec at all, then a code-generated OpenAPI spec (which looked automatic but silently let breaking changes slip into production), and finally a design-first contract owned by an architect, versioned with semver, and enforced via generated server and client code. Technical details cover Maven's OpenAPI Generator plugin for Spring Boot, MapStruct mappers configured to fail on unmapped fields, custom validation via vendor extensions, and generated TypeScript/Swift/Kotlin clients. A side benefit noted is that a precise contract let the security team configure a strict API gateway and WAF, rejecting undeclared traffic before it reaches services.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://itnext.io/the-api-contract-nobody-owned-26c36917431b>

## Questions this post answers

### Why is code-first OpenAPI generation risky even though the spec always stays in sync with the code?

A spec generated from code mirrors whatever the code currently does, including accidental contract changes like an honest field rename during a cleanup. Because no separate artifact requires review before publishing, such changes can reach production without anyone noticing they altered the API, breaking consumers like partner integrations or mobile apps that pinned the old shape.

_Teams weighing code-first versus design-first OpenAPI workflows can track real-world breakdowns like this on daily.dev._

### What Maven plugin options are needed to generate Spring Boot interfaces and models from an OpenAPI spec without extra code?

The OpenAPI Generator Maven plugin with generatorName set to spring, interfaceOnly true to produce only interfaces and models, useBeanValidation true to turn spec constraints like pattern and required into Jakarta validation annotations, and generateBuilders true for native builders. useSpringBoot4 and useJackson3 require generator version 7.21 or newer; on Spring Boot 3, useSpringBoot3 is the default since 7.21.0.

_Developers wiring Spring Boot codegen from an OpenAPI contract can find configuration walkthroughs like this on daily.dev._

### How can MapStruct mappers catch API contract drift that a generated interface alone would miss?

Configuring MapStruct with unmappedTargetPolicy and unmappedSourcePolicy both set to ERROR forces every field on both sides of a mapping to be explicitly mapped or ignored. When a spec change adds or renames a field, the mapper fails to compile until a developer decides in code what the new field means, catching shape drift that a compiling controller interface would not.

_Engineers hardening API layers against silent contract drift can compare mapper strategies like this on daily.dev._

## Similar posts on daily.dev

- [Design-First or Code-First: Pick, and Know the Cost](https://daily.dev/posts/design-first-or-code-first-pick-and-know-the-cost-alzgr7hna) · API Evangelist · 5 upvotes · 5 comments
- [Creating Contractual Service Communication](https://daily.dev/posts/creating-contractual-service-communication-szcd3ru50) · monday Engineering · 84 upvotes · 2 comments
- [A Software Architect’s Guide to API-First Strategy](https://daily.dev/posts/a-software-architect-s-guide-to-api-first-strategy-rjb6qbgkq) · Nordic APIs · 176 upvotes · 2 comments
- [API Versioning Should Be Your Last Resort](https://daily.dev/posts/api-versioning-should-be-your-last-resort-vywyleewk) · Milan Jovanović · 47 upvotes · 5 comments
- [OpenAPI \+ Fastify: let the contract build your server—Martian Chronicles, Evil Martians’ team blog](https://daily.dev/posts/openapi-fastify-let-the-contract-build-your-server-martian-chronicles-evil-martians-team-blog-0bmrac1sx) · Martian Chronicles · 0 upvotes · 0 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#spring-boot](https://daily.dev/tags/spring-boot), [#openapi](https://daily.dev/tags/openapi)

[View this post on daily.dev](https://daily.dev/posts/the-api-contract-nobody-owned-zumpulxcf)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The API Contract Nobody Owned","url":"https://daily.dev/posts/the-api-contract-nobody-owned-zumpulxcf","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-api-contract-nobody-owned-zumpulxcf"},"datePublished":"2026-09-20T21:01:19.457Z","dateModified":"2026-09-20T21:01:45.520Z","description":"A field report walks through a team's year-long evolution from an undocumented, chaos-prone API to a fully API-first workflow. It traces the stages: no spec at...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/458657f101215fa8720fef17d88c9214?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/458657f101215fa8720fef17d88c9214?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"ITNEXT","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"ITNEXT","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/itnext2","url":"https://daily.dev/sources/itnext"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-api-contract-nobody-owned-zumpulxcf","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"architecture,spring-boot,openapi","timeRequired":"PT19M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"ITNEXT","item":"https://daily.dev/sources/itnext"},{"@type":"ListItem","position":3,"name":"The API Contract Nobody Owned"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/the-api-contract-nobody-owned-zumpulxcf#faq","mainEntity":[{"@type":"Question","name":"Why is code-first OpenAPI generation risky even though the spec always stays in sync with the code?","acceptedAnswer":{"@type":"Answer","text":"A spec generated from code mirrors whatever the code currently does, including accidental contract changes like an honest field rename during a cleanup. Because no separate artifact requires review before publishing, such changes can reach production without anyone noticing they altered the API, breaking consumers like partner integrations or mobile apps that pinned the old shape. Teams weighing code-first versus design-first OpenAPI workflows can track real-world breakdowns like this on daily.dev."}},{"@type":"Question","name":"What Maven plugin options are needed to generate Spring Boot interfaces and models from an OpenAPI spec without extra code?","acceptedAnswer":{"@type":"Answer","text":"The OpenAPI Generator Maven plugin with generatorName set to spring, interfaceOnly true to produce only interfaces and models, useBeanValidation true to turn spec constraints like pattern and required into Jakarta validation annotations, and generateBuilders true for native builders. useSpringBoot4 and useJackson3 require generator version 7.21 or newer; on Spring Boot 3, useSpringBoot3 is the default since 7.21.0. Developers wiring Spring Boot codegen from an OpenAPI contract can find configuration walkthroughs like this on daily.dev."}},{"@type":"Question","name":"How can MapStruct mappers catch API contract drift that a generated interface alone would miss?","acceptedAnswer":{"@type":"Answer","text":"Configuring MapStruct with unmappedTargetPolicy and unmappedSourcePolicy both set to ERROR forces every field on both sides of a mapping to be explicitly mapped or ignored. When a spec change adds or renames a field, the mapper fails to compile until a developer decides in code what the new field means, catching shape drift that a compiling controller interface would not. Engineers hardening API layers against silent contract drift can compare mapper strategies like this on daily.dev."}}]}
```

