Skip to content

fix(apigateway): serialization exception with step functions integration#20169

Merged
mergify[bot] merged 9 commits intoaws:mainfrom
jogold:apigw-sfn-quotes
Jul 14, 2022
Merged

fix(apigateway): serialization exception with step functions integration#20169
mergify[bot] merged 9 commits intoaws:mainfrom
jogold:apigw-sfn-quotes

Conversation

@jogold
Copy link
Copy Markdown
Contributor

@jogold jogold commented May 2, 2022

Using single quotes (') in the body results in a serialization
exception from API Gateway (com.amazon.coral.service#SerializationException).

This is because $util.escapeJavaScript() turns regular single quotes
into escaped ones that are not valid in JSON. The solution is to replace
escaped single quotes back to regular single quotes after escaping the
string.

See https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#util-template-reference

image


All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Using single quotes (`'`) in the body results in a serialization
exception from API Gateway (`com.amazon.coral.service#SerializationException`).

This is because `$util.escapeJavaScript()` turns regular single quotes
into escaped ones that are not valid in JSON. The solution is to replace
escaped single quotes back to regular single quotes after escaping the
string.

See https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#util-template-reference
@gitpod-io
Copy link
Copy Markdown

gitpod-io bot commented May 2, 2022

@jogold
Copy link
Copy Markdown
Contributor Author

jogold commented May 10, 2022

@TheRealAmazonKendra ping 😃

@jogold jogold changed the base branch from v1-main to main June 2, 2022 07:15
@jogold
Copy link
Copy Markdown
Contributor Author

jogold commented Jun 14, 2022

@TheRealAmazonKendra can you review this fix?

@jogold
Copy link
Copy Markdown
Contributor Author

jogold commented Jun 28, 2022

@TheRealAmazonKendra can you review this fix?

yes/no?

Copy link
Copy Markdown
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for the contribution and apologies for it taking me so long to circle back to this.

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jul 14, 2022

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 38b06cf
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 6640338 into aws:main Jul 14, 2022
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jul 14, 2022

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@jogold jogold deleted the apigw-sfn-quotes branch July 14, 2022 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants