fix: multiple formats for custom "api_doc" route example#2122
fix: multiple formats for custom "api_doc" route example#2122soyuka merged 1 commit intoapi-platform:3.4from
Conversation
| methods: ['HEAD', 'GET'] | ||
| defaults: | ||
| _format: html |
There was a problem hiding this comment.
Are these necessary as well?
There was a problem hiding this comment.
I think so. Without the methods definition, the route will accept any HTTP verb.
This condition was added in version 3.3.7.
The default format is required for the routing to match the /api_documentation.{_format} pattern. Otherwise, a request to the /api_documentation path results in 404, as the pseudo-extension (.html in this case) is missing.
|
shouldn't we merge this on a 3.x branch? |
I've chosen the Please, let me know if you agree. Otherwise, I can update the target branch to |
@phansys Yes, you're right but we currently support |
d5a490c to
61bdb05
Compare
|
The target branch was changed to |
|
thanks! |
Without the
_formatoption, the resulting route is not able to expose other paths like/api_documentation.jsonopenapi.