Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

77
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda