Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQ] [Java] [Maven] InputSpec download from url #2241

Open
Catscratch opened this issue Feb 26, 2019 · 11 comments
Open

[REQ] [Java] [Maven] InputSpec download from url #2241

Catscratch opened this issue Feb 26, 2019 · 11 comments

Comments

@Catscratch
Copy link

Catscratch commented Feb 26, 2019

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

@wing328
Copy link
Member

wing328 commented Feb 27, 2019

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

@ramzimaalej
Copy link
Contributor

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

@wangtao
Copy link

wangtao commented Mar 12, 2019

+1 for https/http supporting

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

@simasch
Copy link

simasch commented May 3, 2019

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!

@wing328
Copy link
Member

wing328 commented May 3, 2019

There's a work-in-progress PR: #2373

Please help test it when you guys have time.

@wing328 wing328 added this to the 4.0.0 milestone May 3, 2019
@wing328 wing328 modified the milestones: 4.0.0, 4.0.1 May 13, 2019
@wing328 wing328 modified the milestones: 4.0.1, 4.0.2 May 31, 2019
@wing328 wing328 modified the milestones: 4.0.2, 4.0.3 Jun 20, 2019
@wing328 wing328 modified the milestones: 4.0.3, 4.1.0 Jul 9, 2019
@wing328 wing328 modified the milestones: 4.1.0, 4.1.1 Aug 9, 2019
@wing328 wing328 modified the milestones: 4.1.1, 4.1.2 Aug 26, 2019
@wing328 wing328 modified the milestones: 4.1.2, 4.1.3 Sep 11, 2019
@wing328 wing328 modified the milestones: 4.1.3, 4.2.0 Oct 4, 2019
@wing328 wing328 removed this from the 4.2.0 milestone Oct 30, 2019
@tobq
Copy link

tobq commented Feb 16, 2021

Has this been implemented?

@Gama11
Copy link
Contributor

Gama11 commented Mar 10, 2021

It seems like it has: #3826

@Arsennikum
Copy link

What about implementation for Gradle plugin?

@ghost
Copy link

ghost commented Oct 20, 2021

Looks like it is still not working for redirects: http://petstore.swagger.io/v2/swagger.json

@mivchal333
Copy link

Is it still open? :( It would be so nice feature to use shared api specification between multiple services!

@parenko
Copy link
Contributor

parenko commented Jul 12, 2024

There is an example which works with remote URL:

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

Maybe you are limited to collapsed ApiSpec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants