Function to check if the params for an action are valid

I was wondering if there is an Ash function somewhere that I can use to validate if the params for an action are valid or not before I actually call the action?

There has been some cases where I want to validate that the params are correct (nothing is missing, params are not null, etc) before I actually call the action. Right now I implement these validations manually so it is not the best and duplicates code.

Is there some way already implemented in Ash to do that?

changeset = Ash.Changeset.for_action(params, ...)

changeset.valid?
changeset.errors
1 Like

Ah, of course! I should’ve though of that :sweat_smile: