Describe the bug
When I try to setup AshJsonApi with a generic action, if there are required arguments it returns an error but without the field name:
To Reproduce
With a simple Ash.Resource and a route like this:
defmodule App.Core.Test do
use Ash.Resource,
domain: App.Core,
extensions: [
AshJsonApi.Resource,
]
json_api do
type "test"
routes do
base("/test")
route(:get, "/:id/data", :read_data)
end
end
resource do
require_primary_key? false
end
attributes do
attribute :name, :string, public?: true
end
actions do
action :read_data, :struct do
argument :id, :uuid, allow_nil?: false
argument :name, :string, allow_nil?: false
run fn input, context ->
input.arguments.name
end
end
end
end
Expected behavior
The field seems to be missing because the error structure is like this:
Describe the bug When I try to setup AshJsonApi with a generic action, if there are required arguments it returns an error but without the field name:
To Reproduce With a simple Ash.Resource and a route like this:
Expected behavior The field seems to be missing because the error structure is like this:
but the implementation for the error is looking for error.vars and not error.field