A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/swagger-api/swagger-codegen/issues/9540 below:

[Java] supporting files like ApiClient cannot be generated because of bug in 2.4.6 · Issue #9540 · swagger-api/swagger-codegen · GitHub

Description

Due to a breaking change in 2.4.6 (compared to 2.4.5), generating supporting files like e.g. ApiClient.java that are necessary for producing a working client has become impossible.

Swagger-codegen version

version 2.4.6

Swagger declaration file content or url

any yaml (e.g. petstore).

Command line used for generation

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l java --library resttemplate -o ../petstore-server

Steps to reproduce
  1. Use any yaml or json service description (e.g. petstore)
  2. try to generate a client for language "java", and library "resttemplate"
  3. observe that NO supporting files have been generated in the output directory (so no ApiClient in the (specified or implicit) invokerPackage)
Related issues/PRs

none

Suggest a fix/enhancement

The problem is with the 2.4.6 version of io.swagger.codegen.DefaultGenerator#configureGeneratorProperties(), specifically line 138 (which was line 130 in 2.4.5).
Whereas the 2.4.5 version was setting the isGenerateSupportingFiles boolean flag to TRUE whenever a non-null system property "supportingFiles" existed, the 2.4.6 version only sets this flag to TRUE when that system property exists, AND is equal to (ignoring case) "true".
The problem with this, is that this system property serves a dual purpose - DefaultGenerator.generateSupportingFiles() interprets it as a comma separated 'whitelist' of supporting files to generate; lines 588 - 594 (of the 2.4.6 version) skip any file to be generated, if its name is not contained within this comma separated list.
So, setting -DsupportingFiles=true does not help in 2.4.6, since the whitelist will be "true" and of course no supporting files match that.

Fix/enhancement: either

  1. revert the change that was made in 2.4.6, or
  2. retire the code in lines 588 - 594, or
  3. use a different property name if the 'whitelist' functionality is to be maintained.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4