Consider the following code:
```c#
dynamic dObj = System.Web.Helpers.Json.Decode ( contentsOfJsonFile );
// where:
dObj.title // is a flat string
dObj.description // is a flat string
dObj.tags // is an array! ["videos", "pictures", "other assets"]
```
Now, if we access dObj.tags[0] it returns string value. But if we do:
```c#
Json.Encode( dObj )
```
it will convert the object back to JSON string, except the arrays (tags). Apparently, there is a BUG with nested array scenario.
In other words:
```c#
jsonString != Encode( Decode( jsonString ) )
```
*where at atleast one field of JSON has array value.*
For instance, after decoding, encoding this object:
```json
{
"version":3,
"file":"respond.min.js",
"lineCount":1,
"mappings":"CAAM",
"sources":["respond.js"],
"names":["window","matchMedia","doc","bool","docElem"]
}
```
the values of "sources" and "names" will be lost by `Encode()`.
The same works with JSON.NET (third party newtonking library).
Please fix this issue with the native `System.Web.Helpers.Json.Encode()` method.
Thank you.
```c#
dynamic dObj = System.Web.Helpers.Json.Decode ( contentsOfJsonFile );
// where:
dObj.title // is a flat string
dObj.description // is a flat string
dObj.tags // is an array! ["videos", "pictures", "other assets"]
```
Now, if we access dObj.tags[0] it returns string value. But if we do:
```c#
Json.Encode( dObj )
```
it will convert the object back to JSON string, except the arrays (tags). Apparently, there is a BUG with nested array scenario.
In other words:
```c#
jsonString != Encode( Decode( jsonString ) )
```
*where at atleast one field of JSON has array value.*
For instance, after decoding, encoding this object:
```json
{
"version":3,
"file":"respond.min.js",
"lineCount":1,
"mappings":"CAAM",
"sources":["respond.js"],
"names":["window","matchMedia","doc","bool","docElem"]
}
```
the values of "sources" and "names" will be lost by `Encode()`.
The same works with JSON.NET (third party newtonking library).
Please fix this issue with the native `System.Web.Helpers.Json.Encode()` method.
Thank you.