I am currently facing an issue while trying to integrate AWS API Gateway with CloudSearch. I have followed the official documentation to perform the integration.
The problem arises when my backend service sends requests with a slash in query parameters to the API Gateway, which are then sent to CloudSearch.
Here's an example:
Backend service sends: pretty%3Dtrue%26fq%3Dsectors%3A%27One%2FTwo%27%26q%3Dmatchall%26q.parser%3Dstructured
API Gateway decodes it to: pretty=true&fq=sectors:'One/Two'&q=matchall&q.parser=structured
Then, it sends to CloudSearch: q=matchall&pretty=true&q.parser=structured&fq=sectors:'One/Two'
Unfortunately, the slash in the request is no longer encoded when it reaches CloudSearch, which results in a 404 NOT Found error.
I have tried different encodings for slash and tried to find some settings in API Gateway that could help.
I have also found a similar unresolved thread here: link
I would appreciate any insights or suggestions on how to resolve this issue. Is there a way to force API Gateway not to decode parameters, or to make CloudSearch expect decoded parameters?
Many thanks for considering my request.
I have tried to pass encoded and double-encoded values to the API gateway and I have also been attempting to hardcode query values in mapping templates, just to see if it works. All attempts are unsuccessful. If I pass the encoded value to API Gateway through the Test tab Input: pretty=true&fq=sectors:'One%2FTwo'&q=matchall&q.parser=structured Output: q=matchall&q.parser=structured&pretty=true&fq=sectors:'One%252FTwo' Same for double encoded and if I hardcode query values in mapping templates