OpenPayments.Types.ClientDisplay (open_payments_elixir v1.0.0)

Copy Markdown View Source

Self-asserted client information shown by an authorization server during consent.

The pinned client-display schema permits optional name, uri and logo_uri fields and forbids other fields. Omitted fields become nil and are omitted on encoding; explicit JSON nulls are invalid. An empty display object is permitted.

URI fields follow the schema's absolute-URI format. Their spelling is preserved, including data: image URIs. This type does not fetch an image, verify ownership, or restrict URI schemes to HTTP. The wire field is logo_uri, not logoUri.

Struct literals can bypass validation. Call validate/1 after constructing or modifying a struct; to_map/1 converts its shape without validating it.

Summary

Functions

Decodes and validates client-display JSON without fetching its URIs.

Converts to protocol fields, omitting nil values, without validating.

Validates a struct, treating nil fields as omitted.

Types

t()

@type t() :: %OpenPayments.Types.ClientDisplay{
  logo_uri: String.t() | nil,
  name: String.t() | nil,
  uri: String.t() | nil
}

Functions

from_map(data)

@spec from_map(map()) :: {:ok, t()} | {:error, OpenPayments.Error.t()}

Decodes and validates client-display JSON without fetching its URIs.

to_map(display)

@spec to_map(t()) :: map()

Converts to protocol fields, omitting nil values, without validating.

validate(display)

@spec validate(t()) :: :ok | {:error, OpenPayments.Error.t()}

Validates a struct, treating nil fields as omitted.