Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swagger-codegen get started

I'm looking to get into Swagger, more specifically, the swagger-codegen tool. I find the provided information, documentation and specs in both github and http://swagger.io/ to be rather confusing (plus, some links to code examples were broken /404/). Is there any portal where I can see some get started tutorials, code examples, etc aimed for beginners, using these tools?

like image 242
Светлин Славов Avatar asked Jul 23 '15 08:07

Светлин Славов


1 Answers

The Swagger-Codegen github page contains a section showing how to generate a sample client.

Assuming you've the Swagger spec, you can also generate the API client online. Here is an example:

curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"http://petstore.swagger.io/v2/swagger.json"}' http://generator.swagger.io/api/gen/servers/spring-mvc

For broken links in the swagger-codegen's github page, please report the issue here

UPDATE: On May 2018, about 50 top contributors and template creators of Swagger Codegen decided to fork Swagger Codegen to maintain a community-driven version called OpenAPI Generator. Please refer to the Q&A for more information.

like image 92
William Cheng Avatar answered Oct 11 '22 21:10

William Cheng