Skip to content

Ignore non attr or arg params#58

Merged
Torkan merged 3 commits intomainfrom
ignore-non-attr-or-arg-params
Aug 14, 2025
Merged

Ignore non attr or arg params#58
Torkan merged 3 commits intomainfrom
ignore-non-attr-or-arg-params

Conversation

@Torkan
Copy link
Copy Markdown
Collaborator

@Torkan Torkan commented Aug 11, 2025

Fixes #57

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

attr = Ash.Resource.Info.attribute(changeset.resource, key) ->
Map.put(acc, key, cast_and_dump_value(value, attr))

arg = Enum.find(changeset.action.arguments, &(&1.name == key)) ->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This won't handle cases where param key was a string.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is weird I know but we don't normalize strings to atoms in params.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ah, I wasn't aware, thanks for spotting that one 😅

Added a fix for that now as well.

@Torkan Torkan merged commit 53b8ac4 into main Aug 14, 2025
22 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.

KeyError when processing parameters that are neither attributes nor arguments

2 participants