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
Custom MIME type and versioning cause failures #1399
Comments
Hum there are apparently 2 bugs in cause. So until a fix is applied on symfony you have to use this in your config: mime_types:
json: ['application/vnd.foo.api+json;version=3', 'application/vnd.foo.api+json'] |
@Ener-Getick appreciate the speedy and detailed response :) Hopefully everything will get sorted at both ends soon! |
@araines thank you for your report, we need people like you to tell us when a feature breaks and we don't catch it :-) |
…ameters (Ener-Getick) This PR was merged into the 2.3 branch. Discussion ---------- [HttpFoundation] Fix support of custom mime types with parameters | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | FriendsOfSymfony/FOSRestBundle#1399 | License | MIT When using mime types with parameters, ``getFormat`` won't return the expected format as illustrated: ```php $request = new Request(); $request->setFormat('custom', 'app/foo;param=bar'); $request->getFormat('app/foo;param=bar'); // will return null as the parameters are removed ``` So my proposal is to search the format corresponding to a mime type with its raw value or with the its parameters removed. Commits ------- f7ad285 [Request] Fix support of custom mime types with parameters
Fixed in symfony/symfony#18255, you'll be able to use this fix as soon as patch versions are released ;-) |
FOSRestBundle 2.0 Beta 2
Symfony 2.7
I'm trying to implement a custom MIME type on my API, and require all clients to use it. This part appears to work fine until I start to try to add versioning.
config.yml
When I send a request, I get a HTTP406 (Not Acceptable) response:
Individually, both of these features appear to work. For example, if I change my mime type as follows:
And send a request:
Then I get the response I expect.
Also if I set it to my custom vendor descriptor:
This also works (I get a HTTP200 response).
The text was updated successfully, but these errors were encountered: