How to generate Open API files on Bazel?

Viewed 148

So we are migrating a Maven project to Bazel. In this project, we generated our Open API documentation from Java annotations and using the swagger-maven-plugin as follows:

<plugin>
    <groupId>io.swagger.core.v3</groupId>
    <artifactId>swagger-maven-plugin</artifactId>
    <version>2.1.1</version>
    <configuration>
        <outputFileName>swagger</outputFileName>
        <outputPath>${project.basedir}/src/main/resources/webroot</outputPath>
        <outputFormat>JSON</outputFormat>
        <resourcePackages>
            <package>com.example.package1</package>
            <package>com.example.package2</package>
        </resourcePackages>
        <prettyPrint>true</prettyPrint>
    </configuration>
    <executions>
        <execution>
            <phase>compile</phase>
            <goals>
                <goal>resolve</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Is there a way to generate this file using a Bazel rule?

0 Answers
Related