0

I am converting my object to JSON with Serialization method and my JSON appears in the double quotes. Am I missing escaping method ?

 Dim strJSONData As String = Serialization.JSONSerializer.Serialize(Obj)

My output looks like,

{""OrdKey"":0,""OrdNum"":0,""Menu"":""HH"",""OrdTypeKey"":2,""OrdType"":""Pick Up"",""Subtotal"":11.7400,""Tax"":1.00,""DlvyFee"":0.0,""DlvyFeeTxbl"":false,""OrigTotal"":11.7400,""AdjAmt"":0.0}
Pavel Anikhouski
  • 21,776
  • 12
  • 51
  • 66
Ris
  • 1,152
  • 7
  • 29
  • 63

1 Answers1

3

What you're seeing is a verbatim string literal, where the quotes must be escaped by doubling them. There is nothing wrong with the output, it's just showing double quotes in the debugger, but if you were to write it to a file, or send it to an API, they would not be doubled up.

Edit: See this question for more context. Apparently all strings in VB.NET are verbatim string literals: How to do a verbatim string literal in VB.NET?

stjns
  • 1,420
  • 13
  • 16