A Typo Led to the Creation of Spring Cloud Contract • Marcin Grzejszczak & Jakub Pilimon • GOTO 2026
Marcin Grzejszczak, a Java Champion and Spring Cloud Contract contributor, discusses how a production-breaking typo led to the creation of Spring Cloud Contract. He outlines an AI-powered future for contract testing, leveraging production traffic and OpenAPI specs to generate and validate contracts automatically. Marcin also emphasizes that 'context' is the most underrated pillar of observability, transforming raw logs, metrics, and traces into actionable insights.
Marcin Grzejszczak, a Java Champion and key contributor to the Spring ecosystem, recounts his 15-year career journey, marked by significant contributions to microservices architecture, contract testing, and observability. His career began in 2010 as a C++ developer in France, transitioning to Java and eventually joining Pivotal in 2015, where he worked extensively on the Spring Cloud framework. Currently, he’s at HeroDevs, focusing on long-term support for OSS libraries.
The Genesis of Spring Cloud Contract
Marcin’s time at a fintech company, undergoing digital transformation, exposed the classic challenges of microservices adoption. Inspired by Sam Newman’s “Building Microservices,” he co-created an internal open-source library called “MicroInfra Spring.” This toolkit addressed crucial microservices problems, including service discovery, distributed tracing, and early forms of contract testing. These foundational efforts were eventually contributed to Spring Cloud, leading to his recruitment at Pivotal.
The most pivotal moment in the evolution of what would become Spring Cloud Contract (originally Accurest) stemmed from a real production incident. A junior developer, applying the “Boy Scout rule” by fixing a typo in an API (e.g., changing interests to interest), inadvertently broke all dependent clients. The problem was that the server-side change went undetected because there was no mechanism to verify client-server compatibility, leading to a silent production failure. This incident highlighted the dire need for automated contract validation.
Spring Cloud Contract addresses this by reversing Ian Robinson’s consumer-driven contract concept. Instead of clients dictating server behavior, the server defines its contract and publishes stubs. Clients then test against these stubs, immediately detecting breaking changes like the aforementioned typo. Marcin candidly shares that some early code, like the JSON to JSON path converter class, was a source of embarrassment, even containing a Javadoc apology. This led to a unique architectural modeling session with Jakub Pilimon, involving users, to improve the library’s design.
AI’s Role in Future-Proofing Contract Testing
Marcin, referencing ideas from Tom Akehurst (author of WireMock), explores how AI can overcome the current limitations of contract testing, such as the high cognitive load and abandonment of manually written contracts. The proposed AI-powered workflow involves:
- Capturing Production Traffic: Live traffic data is collected (with careful consideration for security and data obfuscation).
- AI-Generated Contracts: AI processes this captured traffic to automatically generate contracts, potentially as WireMock stubs or Spring Cloud Contracts.
- OpenAPI Spec Validation: The generated contracts are then automatically checked against existing OpenAPI specifications. Inconsistencies (e.g., an AI-generated contract indicating an optional field while the OpenAPI spec demands it as required) can be flagged.
- Human in the Loop: Developers shift from manual contract writing to reviewing and approving AI-generated contracts, allowing them to focus on high-level validation and ensuring consistency. This significantly reduces the technical overhead and makes contract testing more sustainable, less reliant on individual “contract champions.”
Observability: The Critical Role of Context
Marcin, a key contributor to the Micrometer Observation API, argues that while logs, metrics, and traces are commonly cited as the three pillars of observability, the most underrated and crucial element is context. Isolated telemetry data, without understanding the why, is merely noise. Correlating these three pillars with relevant business or technical events—such as a deployment causing a performance drop—provides the necessary insight to understand the root cause and impact of issues. This holistic view is what transforms raw data into actionable intelligence.