Action-specific parameter sanitization
Is there a way to sanitize a random map of params that is used for a specific action?
Here's my exact use case:
- I have a map coming from query string params
- That map may contain extra or invalid keys
- I want to filter out any keys that aren't a valid param/argument for that action
Right now if I don't sanitize the map and pass it along to an action, it fails with a
I see though that Ash obviously knows about the expected parameters (with the
I have found
Here's my exact use case:
- I have a map coming from query string params
- That map may contain extra or invalid keys
- I want to filter out any keys that aren't a valid param/argument for that action
Right now if I don't sanitize the map and pass it along to an action, it fails with a
NoSuchInput error:I see though that Ash obviously knows about the expected parameters (with the
arguments keys on the query, and the inputs key on the NoSuchInputError).I have found
Ash.Filter.parse_filter/2 but it only sanitizes based on public attributes of a resource, not specific to an action.