Skip to content
This repository has been archived by the owner on Sep 30, 2019. It is now read-only.

AppSync Emulator - emulator does not enforce strict JSON in VTL templates #107

Open
cbaron opened this issue Apr 2, 2019 · 1 comment
Open

Comments

@cbaron
Copy link
Contributor

cbaron commented Apr 2, 2019

{
  "version" : "2017-02-28",
  "operation" : "PutItem",
  "key": {
      "type" : { "S": "Ingredient" },
      "position" : { "N": "$ctx.args.input.position" },
  },
  "attributeValues": {
    "name" : { "S": "$ctx.args.input.name" },
    composition: $util.dynamodb.toMapJson($ctx.args.input.composition),
  }
}

Works in the emulator, but not when deployed to AWS -- composition must be wrapped in double quotes:

{
  "version" : "2017-02-28",
  "operation" : "PutItem",
  "key": {
      "type" : { "S": "Ingredient" },
      "position" : { "N": "$ctx.args.input.position" },
  },
  "attributeValues": {
    "name" : { "S": "$ctx.args.input.name" },
    "composition": $util.dynamodb.toMapJson($ctx.args.input.composition),
  }
}
@lightsofapollo
Copy link
Contributor

HRRRM Okay... So the they are not using json 5 but are not using strict json either (trailing commas are fine). Not quite sure right path is here. more investigation needed!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants