openapi
Package openapi generates clients for a given OpenAPI specification
load("openapi", ...)
openapi
load("openapi", "openapi")
Functions
client(spec: Bytes, base_url: String, http_client: http.Client?, security: Dict?)
Example:
spec = fs.read("openapi.json")
client = openapi.client(spec=spec, base_url="https://api.example.com", security={"apiKeyAuth": "secret"})
resp = client.my_operation(args={"param": "value"})
# A call can override just the credentials it needs, leaving the rest as
# given to openapi.client:
resp = client.my_operation(args={"param": "value"}, security={"apiKeyAuth": "other-secret"})
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
spec | Bytes | ✓ | |
base_url | String | ✓ | |
http_client | http.Client | ||
security | Dict |
Returns: Client