Skip to content

Update readme with APIs for adding/parsing custom mime types in Rails 5 #130

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

Merged
merged 1 commit into from
Jan 10, 2020

Conversation

unicornzero
Copy link
Contributor

Option 1:
Asapplication/vnd.api+json requests are parsed like standard application/json, we do not need to register a separate mime type. Documentation has therefore been added to show how to add a synonym for json parsing without creating a separate mime type.

Option 2:
Per the Rails changelog the correct API for adding parameter parsers is ActionDispatch::Request.parameter_parsers=. Not using this API can lead to conflicts when an application needs to add other parameter parsers or mime types.

Both approaches work.

Copy link
Collaborator

@djones djones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍍 LGTM

@djones
Copy link
Collaborator

djones commented Jan 10, 2020

Congrats on your first contribution @unicornzero!

@djones djones merged commit 9657e2a into fotinakis:master Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants