Openapi-generator: [REQ] [Java] [Maven] InputSpec download from url

Created on 26 Feb 2019  路  5Comments  路  Source: OpenAPITools/openapi-generator

Currently inputSpec must be a file located in the filesystem.

It would be nice to provide an uri like "file:///..." or "http://..." and the maven plugins decides whether it should download the file first or not.

Usually to wanna generate sources for a public service providing a swagger.json file somewhere.

Changes could happen here: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java#L383

Feature OpenAPI Generator Maven Plugin

Most helpful comment

+1 for https/http supporting

I am using maven plugin for some kind of automatic CI process.

All 5 comments

I think the input parameter (-i in CLI or inputSpec in plugins) already supports URL. Can you try this one?

https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml

@wing328 he is referring to the maven-plugin. I will give it a look.

+1 for https/http supporting

I am using maven plugin for some kind of automatic CI process.

That's a very important feature. APIs are usually published on a web server and you don't want to download it just to generate the code!

There's a work-in-progress PR: https://github.com/OpenAPITools/openapi-generator/pull/2373

Please help test it when you guys have time.

Was this page helpful?
0 / 5 - 0 ratings