Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #1081
Closed
Open
Issue created Sep 21, 2018 by Administrator@rootContributor

Feature request: Support overwrite-only-changed

Created by: wheezil

Description

When using code-generators in an incremental build, it is time-consuming to have the generator touch all output files and cascade into build dependencies, even if nothing has changed. While one can usually make build systems only generate code when the input specification has changed, it is not always possible (for example, Visual Studio lacks a decent "generated sources" dependency mechanism). Even when the dependency chain works, it would be nice to only update the changed files, so that e.g. changing one field in a module doesn't cause everything to rebuild.

openapi-generator version

3.3.0

OpenAPI declaration file content or url

N/A

Command line used for generation

Currently using a custom generator of our own development. However I believe the problem/solution to cut across all generators.

Steps to reproduce

Run any code-generation. Note output file timestamps. Run it again. Note output file timestamps have all changed.

Related issues/PRs

None that I know of.

Suggest a fix/enhancement

Add a command-line option --minimal-update to turn on this new behavior. When this option is specified, the generator will write a temporary file, compare its contents to the existing file, and if they differ, overwrite the existing file. It is possible to use hash-based conditions, but that probably adds complexity without any concrete benefit.

Assignee
Assign to
Time tracking