Skip to content

bugfix: honor configured OpenAPI Generator version across generation pipeline #21

@bsayli

Description

@bsayli

Describe the bug

The configured openapi-generator.version property was not consistently honored across the full client generation pipeline.

While consumers could override the OpenAPI Generator plugin version, other generation stages could still resolve a different generator version through transitive dependency management or implicit artifact resolution.

This created a mixed runtime where:

  • openapi-generator-maven-plugin
  • extracted upstream templates (model.mustache)
  • plugin runtime dependencies (openapi-generator-core, openapi-generator)
  • internal generator execution

could silently diverge.

As a result, overriding openapi-generator.version in consumer projects did not guarantee deterministic generator alignment.

The issue became observable when testing custom OpenAPI Generator versions against the openapi-generics-java-codegen-parent setup.

Steps to reproduce

  1. Create a consumer project using openapi-generics-java-codegen-parent
  2. Override:
<openapi-generator.version>...</openapi-generator.version>
  1. Run:
mvn clean generate-sources
  1. Observe that:
  • plugin execution version,
  • extracted upstream templates,
  • and generator runtime dependencies

are not guaranteed to resolve to the same OpenAPI Generator version.

Expected behavior

The configured openapi-generator.version property should act as the single authoritative version source across the entire generation lifecycle.

The following components must always resolve to the exact same version:

  • openapi-generator-maven-plugin
  • openapi-generator
  • openapi-generator-core
  • extracted upstream templates

This ensures deterministic and reproducible generation behavior for all consumers.

Affected area

  • generator version alignment
  • build orchestration
  • advanced generator customization

Environment

No response

Additional context

Root cause was implicit version resolution through dependency management combined with partial plugin-level version overrides.

The fix explicitly wires ${openapi-generator.version} into:

  • template extraction artifacts
  • plugin runtime dependencies
  • generator plugin version

This restores deterministic version alignment across the entire generation pipeline.

Fixed on main and currently available in 1.0.3-SNAPSHOT.
Planned for the next public release.

Implementation reference:
e58466a

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions