In my Ash resource, I’ve defined an action which returns a map like below:
actions do
action :get_presigned_url, :map do
run fn _, _ ->
...
{:ok, %{filename: filename, presigned_url: presigned_url}}
end
end
end
But the above code returns an error saying that
an exception was raised:
** (Spark.Error.DslError) [MyApp.Domain]
json_api -> routes -> get -> get_presigned_url_for_audio:
Invalid return type for generic action used in get route.
Expected type `:struct`
Expected constraints: instance_of: Dharana.Resource
Got type: Ash.Type.Map
Got constraints: []
Is it possible to do what I’m trying to do? I’m looking for a way to only send the map as the response through Ash