Overview

yaml-combine-maven-plugin is a maven plugin which provides a pre-processor for combining YAML source files, 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

yaml-combine extends the swagger interface definition language with a new $xref referencing method, but it is not limitted to just processing swagger files.

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

License

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

Back to top

Reflow Maven skin by Andrius Velykis.