AshScim.Verifiers.Relationship (ash_scim v0.1.0)

Copy Markdown View Source

Compile-time verifier for multivalued declarations.

For relationship-backed multivalueds:

  • the relationship exists on the resource
  • it is a has_many
  • every sub-map whose :attribute is set names a real attribute on the related resource

For multivalueds with mirror_primary_to::

  • mirror_primary_to requires relationship: to also be set
  • the named attribute exists on the parent resource
  • the multivalued declares a sub-map for the SCIM :value sub-attribute (since that's what gets mirrored)

This catches typos at compile time so users don't get cryptic runtime errors from manage_relationship or the encoder's load step.