<p dir="auto">I have not had a chance to test this under other conditions yet, but i suspect it may affect other non mod_rewrite url rewriting modules, and does not happen with path info based routing, nor when a bundle:controller:action style path is given.</p>
<p dir="auto">given the twig snippet:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{% render url('some_partial') %}"><pre class="notranslate"><code class="notranslate">{% render url('some_partial') %}
</code></pre></div>
<p dir="auto">the sub request to handle the render tag seems to ignore the uri passed to it and use UNENCODED_URL instead, this continues round and round until the stack gets too big and it errors.</p>
<p dir="auto">from a really quick look it appears to be a conflict in how <a href="https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/Request.php#L1461">Request::prepareRequestUri</a> retrieves the uri and how <a href="https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/Request.php#L268">Request::create</a> creates it, along with the fact <a href="https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/RenderingStrategy/DefaultRenderingStrategy.php#L77">DefaultRenderingStratergy::createSubRequest</a> passes through the original server array.</p>
<p dir="auto">Off the top of my head a solution might be to check for a SYMFONY_URI environment variable above all else and set that in create method, this would ensure the frameworks value is always honoured.</p>
<p dir="auto">I am using child forms to prevent code duplication as explained here: <a href="https://symfony.com/doc/current/form/inherit_data_option.html" rel="nofollow">https://symfony.com/doc/current/form/inherit_data_option.html</a></p>
<p dir="auto">But this result in "nested" fields names for child forms (<code class="notranslate">foo[address]</code>, <code class="notranslate">foo[zipcode]</code>, etc...).</p>
<p dir="auto">In a classical web application, this is not a problem because Symfony render form HTML and we don't really care about fields names.<br>
But when using it for an API application, we want all the request parameters as the same level and not in a nested sub level.</p>
<p dir="auto">Actually it's possible to set an empty form name on the root form only.<br>
Why can't we make it possible on child forms too?</p>
<p dir="auto">Maybe another way exists to add field of a form type we want to include in our form at the same level of the current form?</p>