Open Catscratch opened 5 years ago
I think the input parameter (-i in CLI or inputSpec in plugins) already supports URL. Can you try this one?
@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.
Has this been implemented?
It seems like it has: https://github.com/OpenAPITools/openapi-generator/pull/3826
What about implementation for Gradle plugin?
Looks like it is still not working for redirects: http://petstore.swagger.io/v2/swagger.json
Is it still open? :( It would be so nice feature to use shared api specification between multiple services!
There is an example which works with remote URL: https://github.com/OpenAPITools/openapi-generator/blob/8938f9dea1ef9ba28bf89e0fbb71c33e1c68a665/modules/openapi-generator-maven-plugin/examples/java-client.xml#L51
Maybe you are limited to collapsed ApiSpec.
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