OpenAPITools / OpenAPITools/openapi-generator

[REQ] Adding diff-merge capability into openapi-generator-cli generate

Open
#6,660 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

I was using openapi-generator-cli to create server stubs for my openapi 3.0.0 template. Realized that everytime I make a modification to schema and generate the server stubs for nodejs-express-server, I only have an option of

  1. dry-run - mock run the stub generation and see which files are going to be impacted OR
  2. override - simply overwrite the newly generated files

I would like to go a step further and trigger a diff-merge while doing generate.
As an alternative, right now, I can create stubs afresh on a new folder and merge from there to the original work-in-progress project folder.

However, Integration with diff/merge tools can be a great time and effort saver for repeated codegens. Most of the times, I go back and forth while creating the API template.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the openapi-generator-cli generate flow and its existing dry-run and override options, using nodejs-express-server as the example generator. Determine how the command reports affected files and define the expected diff-merge behavior and tool integration; done means repeated generation can merge changes into an existing project without simply overwriting files.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, java, nodejs, openapi
Domain
cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.