x-yc-apigateway-integration:dummy extension
Written by
The x-yc-apigateway-integration:dummy
extension returns fixed content with the specified response code and required headers without any third-party service involved.
Supported parameters
The table below lists the parameters specific to API Gateway API gateways. Read more about other parameters in the OpenAPI Specification 3.0
Parameter | Type | Description |
---|---|---|
http_code |
int |
HTTP response code. |
http_headers |
map[string](string|[]string) |
List of headers to be sent in response. Parameters are substituted in http_headers . |
content |
map[string]string |
Data to be sent in response. Can be either real content or mapping from the requested Content-Type into data. This lets you send errors in the requested format: JSON or XML. The * key is used for the default value. Parameters are substituted in content . |
Extension specification
Example specification:
x-yc-apigateway-integration:
type: dummy
http_code: 302
http_headers:
Location: "/some/location"
Set-Cookie: ["a={number}", "b=2"]
content:
"application/json": "{ \"message\": \"You've been redirected.\" }"
Extension specifics:
- If the request has the header
Accept:
- The best match is selected first.
- If there is no match, the
*
key is selected. - If there is no key, the
415 Media not supported
response is returned.
- If the
Accept
header is missing, an arbitrary response is selected. - If the content option is selected by the
*
key, the response'sContent-Type
is picked fromhttp_headers
. If it isn't specified there, the actualContent-Type
is returned.