# Validate

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.JSON2>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                  | Description                                                                                                                                                                              |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Json : `Object`       | <p>Json input needs to be of type string or JToken.</p><p><br>Default: <code>-</code><br>Example: <code>{"key":"value"}</code></p>                                                       |
| JsonSchema : `String` | <p>Json Schema to validate to. Uses Newtonsoft JsonSchema</p><p><br>Default: <code>-</code><br>Example: <code>{"type": "object", "properties": {"name": {"type":"string"} } }</code></p> |
| {% endtab %}          |                                                                                                                                                                                          |

{% tab title="Parameter: Options" %}

| Name                           | Description                                                                                                                                      |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| ThrowOnInvalidJson : `Boolean` | <p>A flag to indicate whether an error should be thrown if JSON was invalid.</p><p><br>Default: <code>-</code><br>Example: <code>true</code></p> |
| {% endtab %}                   |                                                                                                                                                  |

{% tab title="Result: Result" %}

| Name                     | Description                                                                            |
| ------------------------ | -------------------------------------------------------------------------------------- |
| Success : `Boolean`      | <p>Operation complete without errors.<br>Example: <code>true</code></p>                |
| IsValid : `Boolean`      | <p>JSON was valid.<br>Example: <code>true</code></p>                                   |
| Errors : `IList<String>` | <p>List of errors.<br>Example: <code>{ An error occured..., Another error }</code></p> |
| {% endtab %}             |                                                                                        |

{% tab title="Changelog" %}

## Changelog

### \[1.0.0] - 2023-06-15

#### Added

* Initial implementation
  {% endtab %}
  {% endtabs %}
