Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 657
Chandresh Mishra Avatar asked Dec 08 '25 18:12

Chandresh Mishra


1 Answers

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.

like image 185
Mikko Maunu Avatar answered Dec 12 '25 05:12

Mikko Maunu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!