Swagger Codegen Online Generators
One can also generate API client or server using the online generators (https://generator.swagger.io)
For example, to generate Ruby API client, simply send the following HTTP request using curl:
Then you will receive a JSON response with the URL to download the zipped code.
To customize the SDK, you can POST
to https://generator.swagger.io/api/gen/clients/{language}
with the following HTTP body:
in which the options
for a language can be obtained by submitting a GET
request to https://generator.swagger.io/api/gen/clients/{language}
:
For example, curl https://generator.swagger.io/api/gen/clients/python
returns
To set package name to pet_store
, the HTTP body of the request is as follows:
and here is the curl command:
Instead of using swaggerUrl
with an URL to the OpenAPI/Swagger spec, one can include the spec in the JSON payload with spec
, e.g.