Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

76
Views
AWS Model - JSON string inside string type

What I'm trying to do is to have a basic model that takes in a JSON string rather than defined all my variables/elements upfront. My model will take in an "options" element which I want to contain a json string. My model is below.

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "GroceryStoreInputModel",
  "type": "object",
  "properties": {
    "options":{"type":"string"}
  }
}

in my api-gateway, this will work with i just do a basic body like this:

{"options":"this is my options"}

but i get a model not matching error if I replaced the string with a json string.

  {"options":"{\\"name\\":\\"thaison\\",\\"mail\\":\\"test2\\"}"}

I also tried "" escaped but did not work as well, is there a way to do this?

{"options":"{""name"":""thaison"",""mail"":""test2""}"}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

it looks like your payload value for the options node is being interpreted as object instead of string. Can you try the following settings instead to solve the problem?

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "GroceryStoreInputModel",
  "type": "object",
  "properties": {
    "options":{"type":"object"}
  }
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!