0

I ran into an issue when parsing JSON . I am parsing JSON similar to this :

{
  "regularProperty" : "Test here",
  "nestedJSON" : {
    "propertyText1" : "new Text",
    "propertyText2" : "new Text",
    "propertyText3" : "new Text"
  }
}

Where it has a nested JSON object in it .

So instead of parsing that nested JSON , I want to store it as a string inside a parsed object.

object I am parsing into looks like this :

 public class SampleClass {
   public string regularProperty {get;set;}
   public string nestedJSON {get; set;}     
 }

So desired parsed object will contain nested JSON as a string:

SampleClass obj; 
obj.regularProperty = "Test here";
obj.nestedJSON = "{
"propertyText1" : "new Text",
"propertyText2" : "new Text",
"propertyText3" : "new Text"
}"

Any ideas how I can achieve that , or is it even possible ?

JmukhadzeT
  • 99
  • 1
  • 9

0 Answers0