Skip to content

Commit

Permalink
style: rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Dec 13, 2022
1 parent 237e2ea commit bcda9a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/pact_broker/api/resources/base_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ def params(options = {})

symbolize_names = !options.key?(:symbolize_names) || options[:symbolize_names]
parsed_params = if symbolize_names
@params_with_symbol_keys ||= JSON.parse(request_body, { symbolize_names: true }.merge(PACT_PARSING_OPTIONS)) #Not load! Otherwise it will try to load Ruby classes.
else
@params_with_string_keys ||= JSON.parse(request_body, { symbolize_names: false }.merge(PACT_PARSING_OPTIONS)) #Not load! Otherwise it will try to load Ruby classes.
end
@params_with_symbol_keys ||= JSON.parse(request_body, { symbolize_names: true }.merge(PACT_PARSING_OPTIONS)) #Not load! Otherwise it will try to load Ruby classes.
else
@params_with_string_keys ||= JSON.parse(request_body, { symbolize_names: false }.merge(PACT_PARSING_OPTIONS)) #Not load! Otherwise it will try to load Ruby classes.
end

if !parsed_params.is_a?(Hash) && !parsed_params.is_a?(Array)
raise "Expected JSON Object in request body but found #{parsed_params.class.name}"
Expand Down

0 comments on commit bcda9a3

Please sign in to comment.