Skip to content

[BUG] [maven generator] cleanupOutput breaks skipIfSpecIsUnchanged  #16490

Description

@Philzen

Bug Report Checklist

Description

If you have this configuration

    <skipIfSpecIsUnchanged>true</skipIfSpecIsUnchanged>
    <cleanupOutput>true</cleanupOutput>

that's effectively as if you hadn't used <skipIfSpecIsUnchanged> at all. All files would be regenerated every time.

Combining them is actually a feasible thing b/c for setups that hold the generated files in their repository, they want no-longer existing model files to disappear, which can only happen when the directory is cleaned before regeneration. At the same time, you wouldn't want all the files to be regenerated on every run, b/c due to the generated annotation @javax.annotation.Generated( date = … ) all files would should up as changed, even if the spec didn't change at all.

openapi-generator version

7.0.1-SNAPSHOT

Suggested fix

This one is pretty simple: cleanupOutput needs to be evaluated after skipIfSpecIsUnchanged in CodeGenMojo.java. I can submit a PR to fix this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions