A2UICore.Validation.Integrity (A2UICore v0.1.1)

Copy Markdown View Source

Payload preflight checks that run before schema validation: global nesting depth, nested function-call depth, and JSON-pointer path syntax. Ported verbatim from the reference's validate_recursion_and_paths.

Limits:

  • @max_global_depth (50) — nesting depth of the whole payload.
  • @max_func_call_depth (5) — nesting of call/@call+args (or v0.8 functionCall) structures.

Path keys checked: "path" and "@path" (v1.0 binds with @path; templates and updateDataModel use path). The relaxed pointer pattern allows absolute (/a/b) and relative (a/b) forms with RFC 6901 escapes (~0, ~1 only).

Summary

Functions

The nested function-call limit.

The global payload nesting limit.

As validate_recursion_and_paths!/1, returning :ok | {:error, error} instead of raising.

Traverses a message payload, raising A2UICore.Error (category :recursion or :validation) when a limit or path syntax is violated. Returns :ok otherwise.

Functions

max_func_call_depth()

(since 0.1.0)
@spec max_func_call_depth() :: pos_integer()

The nested function-call limit.

max_global_depth()

(since 0.1.0)
@spec max_global_depth() :: pos_integer()

The global payload nesting limit.

validate_recursion_and_paths(data)

(since 0.1.0)
@spec validate_recursion_and_paths(term()) :: :ok | {:error, A2UICore.Error.t()}

As validate_recursion_and_paths!/1, returning :ok | {:error, error} instead of raising.

validate_recursion_and_paths!(data)

(since 0.1.0)
@spec validate_recursion_and_paths!(term()) :: :ok

Traverses a message payload, raising A2UICore.Error (category :recursion or :validation) when a limit or path syntax is violated. Returns :ok otherwise.