Overview

swagger-combine-maven-plugin is a maven plugin which provides a pre-processor for combining YAML source files, presumably before those files are then used to generate even more code using the swagger toolchain.

This plugin exists mainly because $ref references are only allowed in one or two places in the swagger spec, and you may want to import objects in other locations.

Goals

Syntax

swagger-combine extends the swagger interface definition language with a new $xref referencing method.

Details on using $xrefs can be found on the github README.

Some more specific use cases are described in the examples below.

Examples

Usage

To use this plugin, include it in your project model

<project>
  <build>
    <plugins>

      <plugin>
        <groupId>com.randomnoun.maven.plugins</groupId>
        <artifactId>swagger-combine-maven-plugin</artifactId>
        <version>1.0.3</version>
        
        <executions>
          <execution>
            <id>swagger-combine</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>swagger-combine</goal>
            </goals>
            <configuration>
              <fileset>
                <includes>
                  <!-- can supply multiple files here or filespecs; e.g. *.yaml -->
                  <include>my-swagger-file-with-xrefs-in-it.yaml</include>
                </includes>
                <directory>${project.basedir}/src/main/swagger</directory>
              </fileset>
              <outputDirectory>${project.basedir}/target/swagger-combine</outputDirectory>
              <!-- use this file as the input to the codegen goal -->
              <finalName>my-swagger-file-with-resolved-xrefs.yaml</finalName>
            </configuration>
          </execution>
        </executions>
      </plugin>
            
    <plugins>
  <build>
<project>

License

swagger-combine is licensed under the Simplified BSD 2-clause license.

Back to top

Reflow Maven skin by Andrius Velykis.