Skip to content

Commit

Permalink
fix error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ryu-sato committed Jan 28, 2023
1 parent d1b7891 commit eb536ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/committee/schema_validator/hyper_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def request_unpack(request)
request.env[validator_option.request_body_hash_key] = request_param

if request_param.is_a?(Array)
raise BadRequest, "Invalid JSON input. Require object with parameters as keys when path parameter exists." if !query_param.empty? || !param_matches_hash.empty?
raise BadRequest, "Invalid JSON input. Require request body typed by object when path/query parameter exists." if !query_param.empty? || !param_matches_hash.empty?

request.env[validator_option.params_key] = Committee::Utils.deep_copy(request_param)
else
Expand Down
2 changes: 1 addition & 1 deletion lib/committee/schema_validator/open_api_3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def copy_coerced_data_to_params(request)

if request.env[validator_option.request_body_hash_key].is_a?(Array)
if (!request.env[validator_option.query_hash_key].empty? || !request.env[validator_option.path_hash_key].empty?)
raise BadRequest, "Invalid JSON input. Require object with parameters as keys when path parameter exists."
raise BadRequest, "Invalid JSON input. Require request body typed by object when path/query parameter exists."
end

request.env[validator_option.params_key] = Committee::Utils.deep_copy(request.env[validator_option.request_body_hash_key])
Expand Down

0 comments on commit eb536ea

Please sign in to comment.