diff --git a/CHANGELOG.md b/CHANGELOG.md index c185b85..8c62afd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - +## [Unreleased] + +- Fix `raw_input` not actually being set as the request's body in + `Atex.XRPC.post/3` when providing a struct as input. ## [0.9.1] - 2026-04-17 diff --git a/lib/atex/xrpc.ex b/lib/atex/xrpc.ex index 26b5d66..4022751 100644 --- a/lib/atex/xrpc.ex +++ b/lib/atex/xrpc.ex @@ -169,9 +169,7 @@ defmodule Atex.XRPC do def post(client, %{__struct__: module} = procedure, opts) do has_raw_input? = - if raw_input = procedure.raw_input do - opts = Keyword.put(opts, :body, raw_input) - + if procedure.raw_input do if Code.ensure_loaded?(module) and function_exported?(module, :content_type, 0) do headers = Keyword.get(opts, :headers, []) @@ -193,7 +191,9 @@ defmodule Atex.XRPC do opts = if has_raw_input? do - put_params(opts, procedure) + opts + |> put_params(procedure) + |> Keyword.put(:body, procedure.raw_input) else opts |> put_params(procedure)