File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -623,13 +623,14 @@ defmodule AshJsonApi.Controllers.Helpers do
623
623
# Normal parameter handling
624
624
case Enum . find ( action . arguments , & ( to_string ( & 1 . name ) == key ) ) do
625
625
nil ->
626
- case Ash.Resource.Info . public_attribute ( resource , key ) do
626
+ case Ash.Resource.Info . attribute ( resource , key ) do
627
627
nil ->
628
628
{ :halt ,
629
629
{ :error ,
630
630
Ash.Error.Invalid.NoSuchInput . exception (
631
631
resource: resource ,
632
632
action: action . name ,
633
+ input: key ,
633
634
inputs: [ ]
634
635
) } }
635
636
Original file line number Diff line number Diff line change @@ -359,13 +359,22 @@ end
359
359
360
360
defimpl AshJsonApi.ToJsonApiError , for: Ash.Error.Invalid.NoSuchInput do
361
361
def to_json_api_error ( error ) do
362
+ vars =
363
+ if error . input do
364
+ error . vars
365
+ |> Map . new ( )
366
+ |> Map . put ( :input , error . input )
367
+ else
368
+ Map . new ( error . vars )
369
+ end
370
+
362
371
% AshJsonApi.Error {
363
372
id: Ash.UUID . generate ( ) ,
364
373
status_code: 422 ,
365
374
code: "no_such_input" ,
366
375
title: "NoSuchInput" ,
367
376
detail: "no such input" ,
368
- meta: Map . new ( error . vars )
377
+ meta: vars
369
378
}
370
379
end
371
380
end
You can’t perform that action at this time.
0 commit comments