Painless Script Convert to JSON not HasMap string

I am trying to fetch an array using aggregation. The array is a nested array that contains a list of its own type.
example :

        public class Attribute
                {
                    public long Id { get; set; }
                    public string Name { get; set; }
                    public string ImageUrl { get; set; }
                    public List<Attribute> Attributes { get; set; }
                }

Now when I running aggregation i am fetching this using params._source.attributes.
Output :

"[{id=1, name=testName, imageUrl=http://sasdasd.com, attributes:[{}] }]"

This is a string of HashMap from what I understood. Now my problem is how can I convert this into JSON as I am not able to directly parse HashMap string in c#.

Please assist if there are any parsers to convert it to JSON

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.