x-yc-apigateway-integration:dummy extension
Written by
Updated at April 18, 2025
The x-yc-apigateway-integration:dummy
extension returns fixed content with the specified response code and required headers without any third-party service involved.
You can add an extension to a specification using the specification constructor.
Supported parameters
The table below lists the parameters specific to API Gateway API gateways. You can find the description of other parameters in the OpenAPI 3.0 specification
Parameter | Type | Description |
---|---|---|
http_code |
int |
HTTP response code. |
http_headers |
map[string](string|[]string) |
It shows the list of headers to send in the response. The parameters are subsituted into http_headers . |
content |
map[string]string |
Data to send in response. It can be either actual content or the result of mapping the requested Content-Type to data. This allows you to send errors in the requested format: JSON or XML. The * key is used for the default value. The parameters are subsituted into content . |
Extension specification
Specification example:
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 features:
- If the request contains the
Accept
header:- 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, any response may be selected. - If the content option is selected by the
*
key, the response'sContent-Type
will be picked fromhttp_headers
. If it is not specified there, the actualContent-Type
is returned.