-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix: multiple formats for custom "api_doc" route example #2122
base: 3.4
Are you sure you want to change the base?
Conversation
methods: ['HEAD', 'GET'] | ||
defaults: | ||
_format: html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these necessary as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Without the
_format
option, the resulting route is not able to expose other paths like/api_documentation.jsonopenapi
.