This module defines limits for JSON decoding and canonical encoding.
Use it when an application needs tighter parse limits than the package profile.
This module does not authorize operations.
Example
{:ok, bounds} = AgentBlueprintProtocol.Bounds.new(%{bytes: 100_000})
Summary
Functions
Validates and normalizes a parse-limit value.
Returns the maximum parse-limit profile.
Builds and validates a value from the supplied options.
Types
@type t() :: %AgentBlueprintProtocol.Bounds{ bytes: pos_integer(), depth: pos_integer(), items: pos_integer(), key: pos_integer(), members: pos_integer(), nodes: pos_integer(), number_lexeme: pos_integer(), string: pos_integer() }
The public data type for AgentBlueprintProtocol.Bounds.
Functions
@spec coerce(t() | map()) :: {:ok, t()} | {:error, AgentBlueprintProtocol.Error.t()}
Validates and normalizes a parse-limit value.
Example
iex> match?({:ok, %AgentBlueprintProtocol.Bounds{bytes: 100}}, AgentBlueprintProtocol.Bounds.coerce(%{bytes: 100}))
true
@spec maximum() :: t()
Returns the maximum parse-limit profile.
Example
iex> is_struct(AgentBlueprintProtocol.Bounds.maximum(), AgentBlueprintProtocol.Bounds)
true
@spec new(map()) :: {:ok, t()} | {:error, AgentBlueprintProtocol.Error.t()}
Builds and validates a value from the supplied options.
Example
iex> match?({:ok, %AgentBlueprintProtocol.Bounds{bytes: 100}}, AgentBlueprintProtocol.Bounds.new(%{bytes: 100}))
true