title: Multiple optional parameters web api attribute routing
body: <p>I am new to attribute routing, and I am not sure if this is even possible.</p>
  <p>I have an attribute route, which works fine like this:</p>
  <pre><code>[HttpGet]
  [Route(&quot;GetIssuesByFlag/{flag:int=3}&quot;)]
  public IEnumerable&lt;IssueDto&gt; GetIssuesByFlag(int flag)
  </code></pre>
  <p>Now I want to add some extra optional parameters to narrow down my search, so I want to add 2 extra optional parameters.</p>
  <p>What I have tried:</p>
  <pre><code>[HttpGet]
  [Route(&quot;GetIssuesByFlag/{flag:int=3?}/{categoryId:int?}/{tagIds?}&quot;)]
  public IEnumerable&lt;IssueDto&gt; GetIssuesByFlag(int flag , int? categoryId = null, int?[] tagIds = null)
  </code></pre>
  <p>This works fine if my call is <code>/api/controller/1/2</code>, but fails with 404 when it comes to <code>/api/controller/1</code>.</p>
  <p>How can I achieve this?</p>
  <p>Edit 1: Nkosi's answer below worked, however an extra modification was needed.</p>
  <pre><code>[HttpGet]
  [Route(&quot;GetIssuesByFlag/{flag:int=3}/{tagIds?}/{categoryId:int?}&quot;)]
  public IEnumerable&lt;IssueDto&gt; GetIssuesByFlag(int flag , List&lt;int&gt; tagIds, int? categoryId = null )
  </code></pre>
  <p>The list or array must be second as it is automatically null if no value is provided and cant be marked as optional with = null.</p>