swagger-api / swagger-api/swagger-codegen

CodegenConfigurator systemProperties are reused between code generation invokations

Open
#4,788 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature: Codegen help wanted Issue: Usage/Installation
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

I'm using the swagger CodegenConfigurator in a gradle build where the swagger codegen project is loaded as a library and is being directly passed into the DefaultGenerator.

This usage in this gradle plugin is very similar to my usage.

If I configure one CodegenConfigurator object with systemProperties being set, these settings seem to be being stored somewhere statically.

I'm observing that if I use a new DefaultGenerator again in the same JVM I end up having files not get generated because of input from a previous run of the generator.

I know that the two CodegenConfigurator objects that I'm passing in are different because I've tested logging the systemProperties variable just before passing it in and for the first call it is populated and the second time it is empty.

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 CodegenConfigurator and DefaultGenerator, then compare their state across two generation runs in the same JVM. Reproduce the Gradle-style usage described in the issue with one populated and one empty systemProperties map; done means the second run is unaffected by the first and generates files according to its own configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, java
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.