Skip to content

Conversation

Torkan
Copy link
Contributor

@Torkan Torkan commented Oct 11, 2025

Fixes #2364

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies


def cast_input(<<_::128>> = value, _), do: {:ok, Ash.UUIDv7.encode(value)}
def cast_input(<<_::48, version::4, _::12, variant::2, _::62>> = value, _) do
if valid_uuid_structure?(version, variant) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we bake this into the pattern match head here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! I'll fix it tomorrow 😎

@zachdaniel zachdaniel merged commit 751d8a4 into main Oct 12, 2025
40 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ash.Type.cast_input(:uuid, <string>, []) gives false positives

2 participants