Skip to main content

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:

NameTypeRequiredDescription
specBytes✓
base_urlString✓
http_clienthttp.Client
securityDict

Returns: Client


Types​

Client​


Operation​


SchemaValue​