Installation

guardrail is available as a modular core, with both sbt and Maven integration. The core can also be run as a stand-alone CLI application, with full support for all features.

guardrail for Dropwizard is generally set up using the maven plugin. This will generate your server or client at build time. The following is an example invocation in a pom.xml file:

    <build>
        <plugins>
            <plugin>
                <groupId>com.twilio</groupId>
                <artifactId>guardrail-maven-plugin_2.12</artifactId>
                <version>0.54.0</version>
                <executions>
                    <execution>
                        <id>generate-app-server</id>
                        <goals>
                            <goal>generate-sources</goal>
                        </goals>
                        <configuration>
                            <language>java</language>
                            <framework>dropwizard</framework>
                            <kind>server</kind>
                            <specPath>server-spec.yaml</specPath>
                            <packageName>demowizard.generated</packageName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            (...)
        </plugins>
    </build>

Prev: What is guardrail? Next: Sample API specification