Class JsonTools
JSON tools
Inheritance
object
JsonTools
Namespace
Syntax
public static class JsonTools
Methods
BeautifyJson(string)
Beautifies the JSON text contained in the file.
Returns
string
Beautified JSON
Declaration
public static string BeautifyJson(string JsonFile)
Parameters
| Name | Type | Description |
|---|---|---|
| JsonFile | string | Path to JSON file. |
Exceptions
| Type | Condition |
|---|---|
| FileNotFoundException |
BeautifyJsonText(string)
Beautifies the JSON text.
Returns
string
Beautified JSON
Declaration
public static string BeautifyJsonText(string JsonText)
Parameters
| Name | Type | Description |
|---|---|---|
| JsonText | string | Contents of a minified JSON. |
FindDifferences(JToken, JToken)
Finds the JSON object differences between the two JSON object tokens
Returns
JObject
A JSON object containing differences for objects
Declaration
public static JObject FindDifferences(JToken sourceObj, JToken targetObj)
Parameters
| Name | Type | Description |
|---|---|---|
| sourceObj | JToken | Source object token |
| targetObj | JToken | Target object token |
MinifyJson(string)
Minifies the JSON text contained in the file.
Returns
string
Minified JSON
Declaration
public static string MinifyJson(string JsonFile)
Parameters
| Name | Type | Description |
|---|---|---|
| JsonFile | string | Path to JSON file. |
Exceptions
| Type | Condition |
|---|---|
| FileNotFoundException |
MinifyJsonText(string)
Minifies the JSON text.
Returns
string
Minified JSON
Declaration
public static string MinifyJsonText(string JsonText)
Parameters
| Name | Type | Description |
|---|---|---|
| JsonText | string | Contents of a beautified JSON. |