Symfony routing yml file with optional parameters
<p>I am trying to route a URL in symfony, the URL to be matched has 3 variants</p>

<pre><code>/test/param1/test.json
/test/param1/param2/test.json
/test/param1/param2/param3/test.json
</code></pre>

<p>I want to do this with a single controller and param2 and param3 are optional parameters.</p>

<p>I have tried regex in <strong>requirements</strong> param2 and param3 to allow a string and nothing, but I can't get all 3 paths to match to go to the same controller.</p>