-
Notifications
You must be signed in to change notification settings - Fork 693
Closed
Description
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
fos_rest:
view:
view_response_listener: force
mime_types:
json: ['application/vnd.foo.api+json;version=3']
versioning:
enabled: true
resolvers:
media_type:
enabled: true
regex: '/version=(?P<version>[0-9]+)/'
format_listener:
enabled: true
rules:
-
path: '^/bracket/'
priorities: ['json']
fallback_format: ~
prefer_extension: false
When I send a request, I get a HTTP406 (Not Acceptable) response:
curl -H 'Accept: application/vnd.foo.api+json;version=3' http://localhost:8080/bar/20
Individually, both of these features appear to work. For example, if I change my mime type as follows:
mime_types:
json: ['application/json;version=3']
And send a request:
curl -H 'Accept: application/json;version=3' http://localhost:8080/bar/20
Then I get the response I expect.
Also if I set it to my custom vendor descriptor:
mime_types:
json: ['application/vnd.foo.api+json;version=3']
curl -H 'Accept: application/vnd.foo.api+json' http://localhost:8080/bar/20
This also works (I get a HTTP200 response).
Metadata
Metadata
Assignees
Labels
No labels