-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure the validator can handle the payload being JSON
At the moment, there's some disparity between how applications that user Minitest and applications that use RSpec pass their payloads. RSpec applications pass the payload as JSON and Minitest applications pass it as a Hash. Currently, the payload is being converted to JSON before being validated by `JSON.fully_validate`. If the object is already JSON then .to_json is called again. This means when JSON.parse is called on the object it does not convert it back to a hash. This commit updates the validator to ensure that the payload is converted to JSON if the object passed is not a string.
- Loading branch information
1 parent
7abd403
commit 5d4ed2e
Showing
2 changed files
with
16 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters