Skip to content

A Spring Boot starter that generates OpenAPI documentation during the test phase of the project

License

Notifications You must be signed in to change notification settings

lundegaard/openapi-spring-test-generator

Repository files navigation

openapi-spring-test-generator

A Spring Boot starter that generates OpenAPI documentation during the test phase of the project.

This library wraps springdoc-openapi library that produces OpenAPI endpoint in running Spring applications.

Maven Central

POM Configuration

Add following dependency with test scope to activate this library. For webflux applications, use openapi-spring-test-generator-weblux artifact.

<project>
  ...
  <dependencies>
    ...
    <dependency>
        <groupId>eu.lundegaard.java</groupId>
        <artifactId>openapi-spring-test-generator-mvc</artifactId>
        <version>${latest-version}</version>
        <scope>test</scope>
    </dependency>
    ...
  </dependencies>
   ...
</project>

Configuration

You can configure output by passing arguments via the surefire plugin.

<project>
    ...
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <systemPropertyVariables>
                        <openpi-generator.generateJson>false</openpi-generator.generateJson>
                        <openpi-generator.generateYaml>true</openpi-generator.generateYaml>
                        <openpi-generator.outputDirectory>target/generated-docs</openpi-generator.outputDirectory>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
Name Default Value Description
openpi-generator.generateJson true If true openapi.json will be generated into the output folder
openpi-generator.generateYaml true If true openapi.yaml will be generated into the output folder
openpi-generator.outputDirectory target/classes/static/docs Output folder

About

A Spring Boot starter that generates OpenAPI documentation during the test phase of the project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages