Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix minor issues #121

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .simplecov_spawn.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
unless ENV["COVERAGE"] && ENV["COVERAGE"].empty?
# frozen_string_literal: true

unless ENV['COVERAGE'] && ENV['COVERAGE'].empty?
require 'simplecov'
require 'simplecov-cobertura'

SimpleCov.command_name 'spawn'
SimpleCov.at_fork.call(Process.pid)
SimpleCov.formatter SimpleCov::Formatter::CoberturaFormatter
SimpleCov.start
end
end
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ gem 'roda'
gem 'rspec-rails'

group :test do
gem 'super_diff'
gem 'simplecov'
gem 'simplecov-cobertura'
gem 'super_diff'
end

group :development do
Expand Down
3 changes: 2 additions & 1 deletion lib/rspec/openapi/record_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ def build(context, example:)
request, response = extract_request_response(context)
return if request.nil?

path, summary, tags, required_request_params, raw_path_params, description, security = extract_request_attributes(request, example)
path, summary, tags, required_request_params, raw_path_params, description, security =
extract_request_attributes(request, example)

request_headers, response_headers = extract_headers(request, response)

Expand Down
7 changes: 4 additions & 3 deletions lib/rspec/openapi/schema_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,12 @@

def adjust_params(value)
value.each do |key, v|
if v.is_a?(ActionDispatch::Http::UploadedFile)
case v

Check warning on line 195 in lib/rspec/openapi/schema_builder.rb

View check run for this annotation

Codecov / codecov/patch

lib/rspec/openapi/schema_builder.rb#L195

Added line #L195 was not covered by tests
when ActionDispatch::Http::UploadedFile
value[key] = v.original_filename
elsif v.is_a?(Hash)
when Hash
adjust_params(v)
elsif v.is_a?(Array)
when Array
result = v.map do |item|
item.is_a?(ActionDispatch::Http::UploadedFile) ? item.original_filename : item
end
Expand Down