I am using rspec api documentation, apitome and oauth2 protocol to build acceptance test to our api. Everything works great with one exception that the request body shown as below:
What I noticed from the generated doc above:
Content-Type: application/x-www-form-urlencoded
post "/api/v1/ticket_carts" do
header "Content-Type", "application/json"
I tried to inspect the params at the server
def create
render json: params
# options = set_ticket_cart_protected_params(filter_params)
# adapter = Adapter::TicketCart.new(options)
# @handler = adapter.handler
# @handler.call
# render json: @handler.order, serializer: adapter.serializer_class
end
The response looked something like this:
From what I saw the server still got params from the client in form-encoded format.
To my conclusion, rspec api documentation did not send content-type as application/json to the server.
Is there anything I've done wrong or what other step need to take to make rspec api documentation send the right content type ( application/json )?