Skip to content

improve Dynamic validation #68

@matt-beanland

Description

@matt-beanland

Improve cast_input/apply stored. The input type for Value and Dynamic should perhaps be Unions. If we have the type dynamically we should apply constraints on it, so that i) it is a properly formed Value with Primitive or Dynamic and/or the Primitive/Dynamic is properly formed. The dynamic should be tested according to the type of the dynamic indicated. It should actually match the type, and fields should be valid.

Dynamic values are limited to Ash.Type.NewType that have storage_type: :map.
These are Ash.TypedStruct, or Ash.Type.NewType that are subtype_of keyword, tuple, map, union, struct

They shouldn't and probably can't be used for Elixir types that happen to be structs in Elixir, such as Decimal, Date, Time, DateTime, etc, these all have their own storage_type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions