Skip to content

[maven plugin] Use configurator for maven plugin#2168

Merged
wing328 merged 2 commits intoswagger-api:masterfrom
jimschubert:maven_plugin_configurator
Mar 1, 2016
Merged

[maven plugin] Use configurator for maven plugin#2168
wing328 merged 2 commits intoswagger-api:masterfrom
jimschubert:maven_plugin_configurator

Conversation

@jimschubert
Copy link
Copy Markdown
Contributor

see #2104

This reduces code duplication between CLI and maven-plugin.
The maven plugin can now support more options like language-specific-primitives and additional-properties.

Here's an example configuration to demonstrate passing additional-properties:

<plugin>
      <groupId>io.swagger</groupId>
      <artifactId>swagger-codegen-maven-plugin</artifactId>
      <version>2.1.6-SNAPSHOT</version>
      <executions>
          <execution>
              <goals>
                  <goal>generate</goal>
              </goals>
              <configuration>
                  <inputSpec>/Users/jim/projects/swagger-codegen/modules/swagger-codegen-maven-plugin/examples/swagger.yaml</inputSpec>
                  <language>csharp</language>
                  <configOptions>
                      <additional-properties>optionalProjectFile=true</additional-properties>
                  </configOptions>
              </configuration>
          </execution>
      </executions>
  </plugin>

@wing328 wing328 added this to the v2.1.6 milestone Feb 18, 2016
@ePaul
Copy link
Copy Markdown
Contributor

ePaul commented Feb 22, 2016

                  <configOptions>
                      <additional-properties>optionalProjectFile=true</additional-properties>
                  </configOptions>

I guess this is out of scope for this pull request, but I think that additional-properties should be of type Map, not string, and thus allow structured entry:

                  <configOptions>
                      <additional-properties>
                          <optionalProjectFile>true</optionalProjectFile>
                      </additional-properties>
                  </configOptions>

I'm not sure how one could do a transition supporting both old and new form, though.

ePaul pushed a commit to ePaul/swagger-codegen that referenced this pull request Feb 22, 2016
This implements the command line arguments `--model-name-prefix` and `--model-name-suffix`
for all languages which do not override `DefaultCodegen.toModelName()`.
This fixes most of swagger-api#1255.

Connection to the maven plugin works with additional-properties, a more explicit
parameter waits for swagger-api#2168.
* to specific settings in CodegenConfigurator.
*
* <p>
* This class exists to facility in testing. These methods could be applied
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"to facilitate testing"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Must've been muscle memory from the day job.

ePaul pushed a commit to ePaul/swagger-codegen that referenced this pull request Feb 26, 2016
This implements the command line arguments `--model-name-prefix` and `--model-name-suffix`
for all languages which do not override `DefaultCodegen.toModelName()`.
This fixes most of swagger-api#1255.

Connection to the maven plugin works with additional-properties, a more explicit
parameter waits for swagger-api#2168.
wing328 added a commit that referenced this pull request Mar 1, 2016
[maven plugin] Use configurator for maven plugin
@wing328 wing328 merged commit 6657434 into swagger-api:master Mar 1, 2016
@jimschubert jimschubert deleted the maven_plugin_configurator branch January 19, 2017 02:57
jpedroh pushed a commit to jpedroh/mining-framework-analysis that referenced this pull request Mar 21, 2025
This implements the command line arguments `--model-name-prefix` and `--model-name-suffix`
for all languages which do not override `DefaultCodegen.toModelName()`.
This fixes most of swagger-api/swagger-codegen#1255.

Connection to the maven plugin works with additional-properties, a more explicit
parameter waits for swagger-api/swagger-codegen#2168.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants