OpenrouterSdk.JSON (OpenRouter SDK v0.1.0)

Copy Markdown View Source

thin shim around json encode/decode.

prefers the built-in JSON module that ships with elixir 1.18+. falls back to Jason if it's available — handy for hosts that already pull it in.

Summary

Functions

decode a json binary into elixir terms. returns {:ok, term} | {:error, reason}

encode a term to an iodata json payload

Functions

decode(binary)

@spec decode(binary()) :: {:ok, term()} | {:error, term()}

decode a json binary into elixir terms. returns {:ok, term} | {:error, reason}

encode!(term)

@spec encode!(term()) :: iodata()

encode a term to an iodata json payload