0

I have a form which has fields name and description. When the form is submitted I store these values as a JSON object in the database. Though when I retrieve the value from the database and try to decode it I get an error if a string value contains several lines:

{
    "SMTPMailAccountID":"7",
    "IsActive":"1",
    "TemplateEmailName":"Cache Topup Alert Email Template ",
    "SystemServiceID":"2",
    "Body":"

     {-TOPUP_REQUEST_DATE-}

     {-TOPUP_RESPONSE_DATE-}

   "
} 

when you parse this json it will give error.Could not validate this json

Emissary
  • 9,954
  • 8
  • 54
  • 65
Yogesh
  • 727
  • 2
  • 7
  • 19

1 Answers1

1

Multiline is not supported by json grammar. An other question which can hep you: Multiline strings in JSON

Community
  • 1
  • 1
Rémy J
  • 108
  • 5