Build-time orchestration layer for deterministic, contract-aware OpenAPI client generation
openapi-generics-java-codegen-parent is the build-time orchestration layer of the OpenAPI Generics client-generation platform.
It assembles and controls the complete generation pipeline by combining:
- upstream OpenAPI Generator
- openapi-generics-java-codegen
- platform templates
- deterministic build orchestration
Its role is precise:
Inherit one parent, provide your OpenAPI specification and standard generator configuration, and get deterministic, contract-aware Java client generation.
This is the primary integration surface for consumers.
- What Problem It Solves
- What It Provides
- How It Works
- Usage
- Optional Contract Alignment
- Compatibility Mode
- What Users Control
- What Users Should Not Override
- Compatibility
- Determinism Guarantees
- Failure Philosophy
- Mental Model
Plain OpenAPI Generator setups tend to evolve differently across projects.
That often leads to:
- duplicated envelope models
- inconsistent template behavior
- fragile regeneration workflows
- contract drift between producers and consumers
- generation logic scattered across multiple build configurations
This parent removes that variability by centralizing the entire generation workflow.
By inheriting this parent, a consumer gets:
- upstream template extraction
- deterministic template patching
- template overlay orchestration
- custom generator wiring (
java-generics-contract) - generated source registration
- fail-fast validation of generation assumptions
- optional contract alignment (BYOC / BYOE)
The consumer does not assemble or maintain the generation pipeline manually.
At build time, the parent orchestrates this flow:
OpenAPI spec
↓
Extract upstream templates
↓
Validate template structure
↓
Patch wrapper insertion points
↓
Overlay platform templates
↓
Execute contract-aware generator
↓
Register generated sources
↓
Compile
The patch step is validated.
If the upstream template structure changes in a way that prevents wrapper integration, the build fails fast instead of generating potentially incorrect client code.
<parent>
<groupId>io.github.blueprint-platform</groupId>
<artifactId>openapi-generics-java-codegen-parent</artifactId>
<version>1.0.2</version>
<relativePath/>
</parent>Use the standard OpenAPI Generator plugin and configure your client as usual.
The parent supplies the orchestration layer and contract-aware generator infrastructure.
mvn clean installGenerated sources are registered automatically.
<additionalProperties>
<additionalProperty>
openapi-generics.response-contract.CustomerDto=io.example.contract.CustomerDto
</additionalProperty>
</additionalProperties>Effect:
- externally owned DTOs are reused
- DTO regeneration is suppressed
- generated wrappers reference the contract type directly
<additionalProperties>
<additionalProperty>
openapi-generics.envelope=io.example.contract.ApiResponse
</additionalProperty>
</additionalProperties>Effect:
- wrapper classes extend the configured envelope
- envelope metadata is injected into generation templates
- the envelope itself is not regenerated
Fallback mode can be enabled:
<openapi.generics.skip>true</openapi.generics.skip>When enabled, orchestration steps are skipped and generation falls back to standard OpenAPI Generator behavior.
Typical use cases:
- debugging
- migration validation
- output comparison
Consumers should control only the normal integration surface:
- input specification
- library selection
- package names
- standard OpenAPI Generator configuration
- BYOC properties
- BYOE properties
- OpenAPI Generator version (within supported ranges)
The parent provides defaults but does not require consumers to use a specific OpenAPI Generator version.
Consumers should not override platform-controlled orchestration steps:
- template extraction workflow
- template patching workflow
- wrapper insertion mechanism
- template overlay path
- generator registration strategy
These components collectively define the deterministic generation pipeline.
| Component | Supported Versions |
|---|---|
| Java | 17+ |
| OpenAPI Generator | Supported 7.x releases |
Notes:
- the parent ships with a default OpenAPI Generator version
- consumers may override the generator version when required
- compatibility is validated against supported 7.x releases
The parent is designed to provide:
- stable build phases
- repeatable template patching
- consistent wrapper generation
- deterministic source registration
- controlled generator wiring
Multiple client projects therefore receive the same contract-aware behavior rather than diverging through local customization.
The parent fails fast when structural assumptions break.
Typical causes:
- upstream template structure changes
- wrapper insertion markers cannot be applied
- platform generation assumptions no longer hold
Principle:
Incorrect generation is worse than no generation.
Think of this module as:
the orchestration layer that turns OpenAPI Generator into a contract-aware client-generation pipeline
Not:
- a runtime library
- a template bundle by itself
- a general-purpose OpenAPI Generator replacement
MIT — see LICENSE