TelemetryUI.JSON (telemetry_ui v5.3.2)

View Source

This module provides a configurable JSON library that defaults to:

  • Built-in JSON module on Elixir >= 1.18
  • Jason library on Elixir < 1.18 (if available)

Configuration

You can configure a custom JSON library in your application config:

config :telemetry_ui, :json_library, MyCustomJSON

The JSON library module must implement an encode!/1 function and a decode!/1 function.

Summary

Functions

Decodes JSON.

Encodes the given data structure to JSON.

Functions

decode!(binary)

@spec decode!(String.t()) :: term()

Decodes JSON.

Raises if decoding fails.

encode!(term)

@spec encode!(term()) :: String.t()

Encodes the given data structure to JSON.

Raises if encoding fails.