-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
How to implement endpoints for specific content-types #1584
Comments
think that you should check both |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
for the record:
and something like this in the endpoint handler
maybe this can be adapted and added as an example to the documention? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I submitted PR #2572 which would fix this issue. |
Issue Description
How to implement endpoints for specific content-types
Checklist
Expected behaviour
I've have an PATCH endpoint which only accepts requests with content-type
application/merge-patch+json
Actual behaviour
Not sure how to implement it
Details
I'm currently trying to create an endpoint which supports the https://tools.ietf.org/html/rfc7396 standard for patching resources.
But im struggling right now how to implement the specific content-type i want to accept.
So every request without the content-type to be set to
application/merge-patch+json
should be rejected with at 415.My two ideas are the following:
or what i've found here so far
I guess the second approach is the better but i'm not sure if there is maybe another solution or what should be prefered?
Thanks
The text was updated successfully, but these errors were encountered: