Chandresh Mishra
Chandresh Mishra

Reputation: 1179

openapi-generator-maven-plugin code gen from http

Can we pass input yml specification HTTP URL in openapi-generator-maven-plugin?

I wanted to keep the input specification and generated code in sync.

Upvotes: 2

Views: 1922

Answers (1)

Mikko Maunu
Mikko Maunu

Reputation: 42074

Yes, with openapi-generator-maven-plugin that is possible by simply giving URL including protocol as inputSpec:

<plugin>
    <groupId>org.openapitools</groupId>
    <artifactId>openapi-generator-maven-plugin</artifactId>
    <version>5.4.0</version>
    <executions>
        <execution>
            ...
            <configuration>
                <inputSpec>https://petstore3.swagger.io/api/v3/openapi.yaml</inputSpec>
                ...
            </configuration>
        </execution>
    </executions>
</plugin>

Updating plugin version might be necessary.

Upvotes: 4

Related Questions