From 970ea6e3d57f221487f3c30426898f755c16ea5e Mon Sep 17 00:00:00 2001 From: Dan Ivovich Date: Tue, 11 Jun 2024 13:06:16 -0400 Subject: [PATCH] Rack input is now optional --- lib/rspec_api_documentation/client_base.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/rspec_api_documentation/client_base.rb b/lib/rspec_api_documentation/client_base.rb index db0560a3..43992989 100644 --- a/lib/rspec_api_documentation/client_base.rb +++ b/lib/rspec_api_documentation/client_base.rb @@ -44,9 +44,12 @@ def process(method, path, params = {}, headers ={}) end def read_request_body - input = last_request.env["rack.input"] - input.rewind - input.read + if input = last_request.env["rack.input"] + input.rewind + input.read + else + "" + end end def document_example(method, path)