-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REQ] maven plugin: remove generateApis
and apisToGenerate
#16964
Comments
🤔 Wouldn't this argument also apply to
? |
Actually i wasn't aware of the Using <configuration>
…
<generateModelTests>false</generateModelTests>
<generateModelDocumentation>false</generateModelDocumentation>
<generateApiTests>false</generateApiTests>
<generateApis>false</generateApis>
<generateSupportingFiles>false</generateSupportingFiles>
<configOptions>
<interfaceOnly>true</interfaceOnly>
</configOptions>
</configuration> will result in the following (nice and concise) output: [INFO] Processing operation addPet
[INFO] Processing operation getPetById
[INFO] Processing operation deletePet
[INFO] writing file /home/user/prog/oss/openapi-generator/modules/openapi-generator-maven-plugin/src/test/resources/issue-16489/target/generated-sources/issue-16489/src/main/java/org/openapitools/client/model/Pet.java
[INFO] Skipped /home/user/prog/oss/openapi-generator/modules/openapi-generator-maven-plugin/src/test/resources/issue-16489/target/generated-sources/issue-16489/docs/Pet.md (Skipped by modelDocs options supplied by user.)
[INFO] Skipping generation of APIs.
[INFO] Skipping generation of Webhooks.
[INFO] Skipping generation of supporting files. While using <configuration>
…
<globalProperties>
<apis>false</apis>
<apiTests>false</apiTests>
<modelDocs>false</modelDocs>
<modelTests>false</modelTests>
<supportingFiles>false</supportingFiles>
</globalProperties>
<configOptions>
<interfaceOnly>true</interfaceOnly>
</configOptions>
</configuration> Will result in the following:
which is not only much more verbose output, but generates two files more. Or did i make a mistake defining the equivalent |
Yes, you are right. Good point!
It's currently not possible. You would have to set side note: https://openapi-generator.tech/docs/globals says about |
Problem
The openapi-generator-maven-plugin currently has 3 different options to influence which Apis will be generated:
generateApis
,apisToGenerate
andglobalProperties.apis
. OpenAPI Generator itself only knows aboutglobalProperties.apis
.generateApis
andapisToGenerate
work by openapi-generator-maven-plugin modifyingglobalProperties.apis
.Some disadvantages with that:
generateApis=false
doesn't actually guarantee that API are not generated. (Specifically when also setting generateModels=false and generateSupportingFiles=false.)related: [BUG] [JAVA] AbstractOpenApiSchema class generated even if generateModels is set to false #16257
Proposal
Therefore I propose to remove the options
generateApis
andapisToGenerate
. All the available functionality is accessible by settingglobalProperties.apis
accordingly.The same probably also applies to
globalProperties.models
andglobalProperties.supportingFiles
.If this proposal is accepted by a maintainer, I'd be open to work on a PR.
The text was updated successfully, but these errors were encountered: