[FrameworkBundle] Added configuration for additionnal request formats#9862
[FrameworkBundle] Added configuration for additionnal request formats#9862gquemener wants to merge 9 commits intosymfony:masterfrom gquemener:master
Conversation
|
That's pretty useful. Could we add AddRequestFormatsListener to HttpKernel? It's certainly useful without the DIC. |
|
That sounds like a good idea to me. |
There was a problem hiding this comment.
testEmptyAdditionalrequestFormats?
|
@fabbot-io still needs some training to get good at analyzing typos in variables and test method names |
There was a problem hiding this comment.
wonder if in symfony/symfony these are straight private
|
+1 for moving @gquemener Can you rebase on current master so that we can get rid of the CS fixes that have been fixed since then? |
There was a problem hiding this comment.
Instead of creating a parameter, I'd inject the value directly into the listener service (like done everywhere else).
|
|
|
Probably out of scope for this pull request, but I wonder if we could have a way for bundles to add additional formats too. I currently have a bundle that needs to add a couple of formats. I could of course use the listener added here and add it a second time to the event listener but that seems unnecessary. |
|
@fabpot Problem with But, except for that point which can be solved with good documentation, I'm not against using |
|
Note I was not suggesting to use |
|
The <framework:request>
<framework:additional-format name="csv">
<framework:mime-type>text/csv</framework:mime-type>
<framework:mime-type>text/plain</framework:mime-type>
</framework:additional-format>
</framework:request>This would be a problem if we replace In the other hand IMO, just |
|
I've moved the listener to the HttpKernel component and dropped the unneeded DIC parameter |
|
I've also rebased on master, but not sure it went well :-/ Anyway, I'll squash before merge at the end |
Reopening of #8944
TODO
additional_formatsto a more meaningful one