Closed
Description
If I have this config for versioning...
version 'v1', using: :header, vendor: 'acme', strict: true, cascade: false
then this should require that I pass the appropriate Accept
request header to get a valid 200
response.
This request should work:
$ curl -H 'Accept:application/vnd.acme-v1+json' http://localhost:3000/api/projects
=> succeeds √
... and it does, returning a successful 200
response.
But, not passing the correct Accept header should result in an error. For example, this request:
$ curl -H 'Accept:application/vnd.acme-nonexistentversion+json' http://localhost:3000/api/projects
=> fails √
... fails with a 406
response as expected.
However, this request returns a successful 200
API response, which is unexpected:
$ curl -H 'Accept:application/xml' http://localhost:3000/api/projects
=> succeeds ?
I didn't make the request with the correct version Accept
header, but I'm getting a successful 200
response. Is this a bug, or have I misunderstood how the strict: true, cascade: false
config settings are supposed to work?