XApiEx.Deserializer (x_api_ex v1.0.0)
Helper functions for deserializing responses into models
Summary
Functions
Update the provided model with a deserialization of a nested value
Decode a JSON string into a plain map or list.
Decode a JSON string and convert the result into the given module's struct.
Functions
@spec deserialize( struct(), atom(), :date | :datetime | :list | :map | :struct, module() ) :: struct()
Update the provided model with a deserialization of a nested value
Decode a JSON string into a plain map or list.
Parameters
json(String.t): A JSON-encoded string.
Returns
{:ok, term}on success{:error, term}on failure
Decode a JSON string and convert the result into the given module's struct.
Parameters
json(String.t): A JSON-encoded string.module(module): The module to decode the parsed value into.
Returns
{:ok, struct}on success{:error, term}on failure