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

Please support openapi-generator for code generation #36

Closed
carddamom opened this issue Nov 9, 2018 · 23 comments
Closed

Please support openapi-generator for code generation #36

carddamom opened this issue Nov 9, 2018 · 23 comments
Assignees

Comments

@carddamom
Copy link

There is now the openapi-generator, which appears to have take over swagger-codegen for openapi 3.0, could mermade support it for server and client SDK generation?

@MikeRalphson
Copy link
Contributor

Do you know if they have a public API server?

@MikeRalphson
Copy link
Contributor

From here the answer seems to be "no". It's not even clear from those instructions whether it's possible to run up the API server via Docker. Maybe @wing328 knows?

@wing328
Copy link

wing328 commented Nov 10, 2018

Please refer to https://github.com/OpenAPITools/openapi-generator#openapi-generator-online-docker-image on how to use the OpenAPI Generator Online Docker Image

@MikeRalphson
Copy link
Contributor

Thanks @wing328 - I think that should be linked to from the page I originally referenced? Is it possible for someone from OpenAPITools to run the API server on a service such as Heroku (I would but I already have a dyno set up which runs nearly 24/7)?

@wing328
Copy link

wing328 commented Nov 12, 2018

I think that should be linked to from the page I originally referenced?

I took your feedback and update the page with a link to the Docker doc: OpenAPITools/openapi-generator#1415

Is it possible for someone from OpenAPITools to run the API server on a service such as Heroku (I would but I already have a dyno set up which runs nearly 24/7)?

We plan to provide an online generator so that people do not need to set up their own. We've contacted several VPS providers but there's no ETA on when we'll be able to offer that.

@MikeRalphson
Copy link
Contributor

Thanks @wing328

@MikeRalphson
Copy link
Contributor

@MikeRalphson
Copy link
Contributor

Should be working now, could you please test?

@carddamom
Copy link
Author

carddamom commented Nov 28, 2018

It works! Thank you to both the mermade and OpenApiTools.

@MikeRalphson
Copy link
Contributor

Thanks for the suggestion and @wing328's help.

@wing328
Copy link

wing328 commented Nov 29, 2018

@MikeRalphson glad to see the integration. Do you mind mentioning "OpenAPI Generator" in the Wizard tab? e.g.

Create server SDK - 39 languages using OpenAPI-Generator
Create client SDK - 59 languages using OpenAPI-Generator

@MikeRalphson
Copy link
Contributor

Yep, that would be good. Will do.

@MikeRalphson
Copy link
Contributor

Links added, thanks.

@MikeRalphson
Copy link
Contributor

@wing328 one thing I noticed is that the download links are coming back as follows:

{"code":"56f9553a-0d0a-4c44-b505-b3b5cd34fdb5","link":"http://localhost:8080/api/gen/download/56f9553a-0d0a-4c44-b505-b3b5cd34fdb5"}

@wing328
Copy link

wing328 commented Nov 29, 2018

@MikeRalphson I just performed some tests and couldn't repeat the issue:

➜  openapi-generator git:(master) curl -X POST -H "content-type:application/json" -d '{"openAPIUrl":"https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"}' http://api.openapi-generator.tech/api/gen/clients/ruby
{"code":"9763e067-6faa-4a7e-840b-7b795c6666d2","link":"http://api.openapi-generator.tech/api/gen/download/9763e067-6faa-4a7e-840b-7b795c6666d2"}

➜  openapi-generator git:(master) curl -X POST -H "content-type:application/json" -d '{"openAPIUrl":"https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"}' http://api-latest-master.openapi-generator.tech/api/gen/clients/ruby
{"code":"faf63928-5fba-4bb6-8a26-41232cdb5bb7","link":"http://api-latest-master.openapi-generator.tech/api/gen/download/faf63928-5fba-4bb6-8a26-41232cdb5bb7"}%

Can you share more with me? which generator did you target?

@wing328
Copy link

wing328 commented Nov 29, 2018

I also did a test earlier wtih openapi-gui to generate Android client and was able to download the file.

@MikeRalphson
Copy link
Contributor

OpenAPI-gui patched out the localhost reference. I'll retest. But this was against stable not latest master.

@wing328
Copy link

wing328 commented Nov 29, 2018

I see. Let me know if I can be of any help to troubleshoot the issue.

@MikeRalphson
Copy link
Contributor

curl -X POST -d '{"spec":{"swagger":"2.0","info":{"title":"","version":""},"paths":{}}}' -H 'content-type: application/json' http://api.openapi-generator.tech/api/gen/servers/haskell
{"code":"e64a59b2-b4cd-4076-a6b4-b11bb3836b18","link":"http://localhost:8080/api/gen/download/e64a59b2-b4cd-4076-a6b4-b11bb3836b18"}

@wing328
Copy link

wing328 commented Nov 29, 2018

I could repeat the issue with another server generator:

➜  openapi-generator git:(master) curl -X POST -H "content-type:application/json" -d '{"openAPIUrl":"https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"}' https://api.openapi-generator.tech/api/gen/servers/python-flask
{"code":"00932bd5-9530-4115-851b-d5cc878060fd","link":"http://localhost:8080/api/gen/download/00932bd5-9530-4115-851b-d5cc878060fd"}%

Looks like it's impacting server but not client generators. We'll look into it.

@MikeRalphson
Copy link
Contributor

Great, thanks.

@wing328
Copy link

wing328 commented Dec 1, 2018

@MikeRalphson we've fixed the issue via OpenAPITools/openapi-generator#1580 and deployed the fix to the server. Please give it another try when you've time.

Have a nice weekend.

@MikeRalphson
Copy link
Contributor

Thanks, will do!

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

3 participants