open-api-spex / open_api_spex

Open API Specifications for Elixir Plug applications
Mozilla Public License 2.0
706 stars 183 forks source link

assert_operation_response is (incorrectly) based on the request's content type, not the response's. #575

Closed tusooa closed 9 months ago

tusooa commented 10 months ago

https://github.com/open-api-spex/open_api_spex/blob/c1dbca17a3d64c107de18d85311a447cd27e96b2/lib/open_api_spex/test/test_assertions.ex#L157C7-L157C58

This line gets the request's content type, and uses it to fetch the response schema. I do not think this is the correct behaviour, as the response schema should only depend on the response's content type.

tusooa commented 10 months ago

See also https://git.pleroma.social/pleroma/pleroma/-/blob/develop/test/support/conn_case.ex?ref_type=heads#L69