You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
I just encountered an issue that I'm not sure is related to this when adding a new POST route pointing to a generic ation.
In this generic action with a required string argument:
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
The text was updated successfully, but these errors were encountered: