Minimal, runnable sample set for the OpenAPI Generics platform.
These samples demonstrate how a Java-based contract is exposed through OpenAPI, consumed via a generated client, and reused by a downstream service without structural drift.
Each sample stack contains:
- Producer → defines the API contract
- Generated client → built from OpenAPI
- Consumer → uses the generated client
The same contract flows through all layers.
Two equivalent stacks are provided:
| Stack | Spring Boot | Producer | Consumer |
|---|---|---|---|
| spring-boot-3 | 3.x | 8084 | 8085 |
| spring-boot-4 | 4.x | 8094 | 8095 |
Behavior is identical. Only runtime differs.
samples
├── domain-contracts
├── spring-boot-3
└── spring-boot-4
Each stack is self-contained and runnable.
- Docker 20+
- Docker Compose v2
cd spring-boot-3
docker compose up --build -d
cd spring-boot-4
docker compose up --build -d
curl http://localhost:8085/customer-service-consumer/customers/1
(or use port 8095 for Spring Boot 4)
curl "http://localhost:8085/customer-service-consumer/customers?page=0&size=5"
(or use port 8095 for Spring Boot 4)
curl http://localhost:8084/customer-service/v3/api-docs.yaml
- The response structure remains consistent across producer and consumer
- Nested generic structures (e.g. paginated responses) are preserved
- No manual mapping is required between layers
From the samples directory:
mvn clean install
Run services individually if needed.
docker compose down
- In-memory data store (no external dependencies)
- Sample domain is intentionally simple
- Focus is on contract flow, not business logic
These samples provide a minimal environment to validate that a contract defined in Java can be exposed, consumed, and reused consistently across service boundaries.