Websocket API error: Execution failed due to configuration error: No match for output mapping and no default output mapping configured. Endpoint Response Status Code: 200

0

I have a websocket API connected to an HTTP API. $default works successfully, but $connect fails. I am configuring it without HTTP_PROXY and have the following request template:

{"connection-id": "$context.connectionId", "event-type": "$context.eventType"}

The request makes it to by backend which then replies with a 200 status code. The response is turned into a 500 error with the above error message appearing in the access logs.

Any suggestions? I've been working on this for two days and can't find an answer.

Thanks.

1 Answer
0

Looks like your integration response key mappings are missing in the Integration Response tab. Take a look at this document - https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-integration-responses.html particularly the below section. Either a $default mapping has to be present or a /2\d\d/ response key has to be present for the backend return code of 200 to be mapped back in the response.

**For non-proxy integrations, you must set up at least one integration response:

Ideally, one of your integration responses should act as a catch-all when no explicit choice can be made. This default case is represented by setting an integration response key of $default.

In all other cases, the integration response key functions as a regular expression. It should follow a format of "/expression/".

For non-proxy HTTP integrations:

API Gateway will attempt to match the HTTP status code of the backend response. The integration response key will function as a regular expression in this case. If a match cannot be found, then $default is chosen as the integration response.

The template selection expression, as described above, functions identically. For example:

/2\d\d/: Receive and transform successful responses

/4\d\d/: Receive and transform bad request errors

$default: Receive and transform all unexpected responses

For current limitations of template selection expressions, see Template selection expressions.**

profile pictureAWS
EXPERT
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions