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
The JSON API media type should only work with a JSON API handler #23712
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,9 +37,9 @@ def teardown | |
) | ||
end | ||
|
||
test "parses json params for application/vnd.api+json" do | ||
test "does not parses unregistered media types such as application/vnd.api+json" do | ||
assert_parses( | ||
{"person" => {"name" => "David"}}, | ||
{}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I kept this test around both in case anyone is looking for json api support, and because I didn't see the behavior tested elsewhere. However, I removed the test for rootless JSON as it duplicates what I left here and also isn't relevant to JSON API. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah. Make sense 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ha, that was quick! you merged it right before I revised the commit message from 'I' to 'we' and fixed a typo. :) Thanks! |
||
"{\"person\": {\"name\": \"David\"}}", { 'CONTENT_TYPE' => 'application/vnd.api+json' } | ||
) | ||
end | ||
|
@@ -143,13 +143,6 @@ def teardown | |
) | ||
end | ||
|
||
test "parses json params for application/vnd.api+json" do | ||
assert_parses( | ||
{"user" => {"username" => "sikachu"}, "username" => "sikachu"}, | ||
"{\"username\": \"sikachu\"}", { 'CONTENT_TYPE' => 'application/vnd.api+json' } | ||
) | ||
end | ||
|
||
test "parses json with non-object JSON content" do | ||
assert_parses( | ||
{"user" => {"_json" => "string content" }, "_json" => "string content" }, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafaelfranca typo
does not parses
should bedoes not parse
. Just leave it for someone else?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can change it quickly, but if you want to make a PR go ahead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's cleaner if you just fix it, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!