ash-project / ash_json_api

The JSON:API extension for the Ash Framework
https://hexdocs.pm/ash_json_api
MIT License
56 stars 40 forks source link

Query parameter not passed as argument #82

Open martinhrvn opened 1 year ago

martinhrvn commented 1 year ago

Describe the bug On mutation the query/path params are not passed as arguments

To Reproduce

If we have route with parameter and we use this parameter as argument for mutation action:

routes do
  post :for_tracker, route: "/trackers/:tracker_id/option"
end

actions do
  create :for_tracker do
    argument :tracker_id, :string, allow_nil?: false
    ...
  end
end

It fails with Required properties are missing: [\"tracker_id\"]

Expected behavior A path parameter is passed as argument to the action.

** Runtime

Additional context

zachdaniel commented 1 year ago

What we need to do here is add an option to the routes for these to say which path parameters should be used in the create/update/destroy action and which should be used in the lookup.