AshScim.Decoder (ash_scim v0.1.0)

Copy Markdown View Source

Decodes inbound SCIM 2.0 JSON payloads into Ash action input.

The decoded result has two parts:

  • :attrs โ€” a flat %{atom => value} map suitable for Ash.Changeset.for_create/3 or for_update/3.
  • :relationships โ€” a %{atom => [%{atom => value}]} map of relationship-management input for relationship-backed multivalued attributes (full-replace semantics for top-level body inclusion).

Per RFC 7644 ยง3.1, unknown attributes are silently dropped. Emit-only static-value mappings are skipped on the way in.

Multivalueds with mirror_primary_to: set additionally write the primary entry's value to the named scalar attribute on the parent.

Summary

Functions

Decode a SCIM resource JSON map into structured Ash action input.

Types

decoded()

@type decoded() :: %{
  attrs: %{required(atom()) => term()},
  relationships: %{required(atom()) => [%{required(atom()) => term()}]}
}

Functions

decode(resource, body)

@spec decode(module(), %{required(String.t()) => term()}) :: decoded()

Decode a SCIM resource JSON map into structured Ash action input.