View Source ExOciSdk.JSON behaviour (ex_oci_sdk v0.2.2)
Defines the behavior for JSON encoding and decoding. This module provides a consistent interface for working with JSON, allowing different implementations (such as Jason, Poison, Native, etc).
Summary
Callbacks
Decodes JSON into an Elixir map.
defines the dependencies necessary for the module
Encodes a map into JSON as iodata.
Types
@type decode_error() :: Exception.t()
@type encode_error() :: Exception.t()
@type json_options() :: keyword()
Callbacks
@callback decode!( input :: iodata(), options :: json_options() ) :: map() | no_return()
Decodes JSON into an Elixir map.
Parameters
input
- JSON string or iodata to decodeoptions
- Decoding options
Raises
decode_error
- If the input is not valid JSON
defines the dependencies necessary for the module
@callback encode_to_iodata!( input :: map(), options :: json_options() ) :: iodata() | no_return()
Encodes a map into JSON as iodata.
Parameters
input
- Map to be encodedoptions
- Encoding options
Raises
encode_error
- If the input cannot be encoded to JSON