# Deserialize

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Unknown

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

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

| Name                | Description                                                                                                                                                                                               |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| FilePath : `String` | <p>Gets or sets the path to the Avro file you want to deserialize.</p><p>The file must be a valid Avro format file.</p><p><br>Default: <code>-</code><br>Example: <code>C:\results\myfile.avro</code></p> |
| {% endtab %}        |                                                                                                                                                                                                           |

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

| Name                             | Description                                                                                                                                                                                                                                                                                        |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ThrowErrorOnFailure : `Boolean`  | <p>Gets or sets a value indicating whether to throw an exception when deserialization fails.</p><p>When set to true, exceptions will be thrown on failure. When set to false, errors will be returned in the Result object.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p> |
| ErrorMessageOnFailure : `String` | <p>Gets or sets a custom error message to use when deserialization fails and ThrowErrorOnFailure is false.</p><p>If empty, the original exception message will be used.</p><p><br>Default: <code>-</code><br>Example: <code>Custom error occurred during Avro deserialization</code></p>           |
| {% endtab %}                     |                                                                                                                                                                                                                                                                                                    |

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

| Name                | Description                                                                                                                                                                                                                           |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Json : `Object`     | <p>Gets or sets the deserialized JSON data as a dynamic object. Contains a JArray with the deserialized Avro records when successful, or error information when failed.<br>Example: <code>\[{"foo": "bar", "number": 123}]</code></p> |
| Success : `Boolean` | <p>Gets or sets a value indicating whether the deserialization operation was successful.<br>Example: <code>true</code></p>                                                                                                            |
| Error : `Error`     | <p>Gets or sets the error information when the deserialization operation fails. This property is null when the operation is successful.<br>Example: <code>null</code></p>                                                             |
| {% endtab %}        |                                                                                                                                                                                                                                       |

{% tab title="Changelog" %}

## Changelog

### \[2.0.0] - 2025-07-25

#### Added

* New Options tab with error handling parameters (ThrowErrorOnFailure, ErrorMessageOnFailure)
* Success property in Result to indicate task status
* Error object in Result with detailed failure info
* Error class with Message and AdditionalInfo properties
* Options class for task configuration
* ErrorHandler helper class for standardized error handling
* Improved error handling with centralized logic

#### Changed

* \[Breaking] Renamed AvroFilePath to FilePath for consistency with Frends naming conventions
* \[Breaking] Moved FilePath from old parameter location to Input tab
* Updated task structure to align with Frends development guidelines

### \[1.0.0] - 2024-05-31

#### Added

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