Swagger-codegen: Is there a flag to turn off implementation generation in swagger-codegen-maven-plugin 2.2.2 ?

Created on 20 Apr 2017  路  4Comments  路  Source: swagger-api/swagger-codegen

Description

The swagger-codegen maven plugin generates implementation for spec files, is there a way to tell the plugin to not generate the implementation files for the api spec?
Basically when i use this plugin to generate api and model files for my yaml spec that I provide, I don't want it to generate implementation files for my api. Version 2.2.1 did not have this, but I need to use 2.2.2 and also not want any api implementation files generated.
{project.baseDir}/target/generated-sources/src/main/java/.../models
{project.baseDir}/target/generated-sources/src/main/java/.../stubs
{project.baseDir}/target/generated-sources/src/main/java/.../stubs/impl <-- I don't want the impl folder and files to be generated.
Thanks much.

Swagger-codegen version 2.2.2
Suggest a Fix

Would be good to have a tag that can be included in the configuration to suppress the generation of implementation files if not needed.

Question

Most helpful comment

Would be good to have a tag that can be included in the configuration to suppress the generation of implementation files if not needed.

Hi, you should use
<configOptions> ... <interfaceOnly>true</interfaceOnly> ... </configOptions>

All 4 comments

Have you tried using .swagger-codegen-ignore?

Ref: https://github.com/swagger-api/swagger-codegen#ignore-file-format

Closing this as there's no update.

Would be good to have a tag that can be included in the configuration to suppress the generation of implementation files if not needed.

Hi, you should use
<configOptions> ... <interfaceOnly>true</interfaceOnly> ... </configOptions>

If we use the interfaceOnly option, the generation of other things like the api documentation is also stopped. Are there any other configOptions which will exclude certain code generation like controllers for example?

Was this page helpful?
0 / 5 - 0 ratings