I have a resource, eg Post, where the post has many Authors. When creating a Post, there should be at least one (1) Author attached to the payload. I know the json api v1 spec does not really outline creating multiple resources at once, but I figured we should be able to regardless?
What I’ve tried so far:
- Passing the relationship in the relationships section of the body - This fails with stack
[error] GenServer #PID<0.767.0> terminating
** (FunctionClauseError) no function clause matching in anonymous fn/2 in AshJsonApi.Request.relationship_change_value/1
(ash_json_api 0.33.1) lib/ash_json_api/request.ex:668: anonymous fn(:error, {:ok, []}) in AshJsonApi.Request.relationship_change_value/1
(elixir 1.15.7) lib/enum.ex:4387: anonymous fn/3 in Enum.reduce/3
- Passing the relationship into the
Postattributes when creating - This does not work, throws an invalid body because theAuthorattribute is not an attribute on the resource but rather a relationship.
I combed through the relationships section of Ash and AshJsonApi but cant seem to find anything related to creating multiple related resources.






















