A tool to render API spec as code.
Download swac
from releases page.
docker run swaggest/swac swac --help
v0.1.0 swac
OpenAPI/Swagger compiler, https://github.com/swaggest/swac
Usage:
swac <action>
action Action name
Allowed values: php-guzzle-client, go-client
...
Example
mkdir petstore && cd petstore
docker run -v $(pwd):/code swaggest/swac swac php-guzzle-client https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v2.0/json/petstore.json --namespace MyApp\\Petstore
composer global require swaggest/swac
swac php-guzzle-client --help
v0.1.0 swac php-guzzle-client
OpenAPI/Swagger compiler, https://github.com/swaggest/swac
Usage:
swac php-guzzle-client <schemaPath> --namespace <namespace>
schemaPath Path/URL to OpenAPI/Swagger schema
Options:
--operations <operations> Operations filter in form of comma-separated list of method/path, default empty
--project-path <projectPath> Path to project root, default ./
--namespace <namespace> Project namespace
Generated client depends on swaggest/rest-client
, guzzlehttp/guzzle
6,
and swaggest/json-schema
.
swac go-client --help
v0.1.0 swac go-client
OpenAPI/Swagger compiler, https://github.com/swaggest/swac
Usage:
swac go-client <schemaPath>
schemaPath Path/URL to OpenAPI/Swagger schema
Options:
--operations <operations> Operations filter in form of comma-separated list of method/path, default empty
--out <out> Path to output package, default ./client
--pkg-name <pkgName> Output package name, default "client"
Generated client is a single package without external dependencies.