title: OpenAPI - how to describe query parameters?
body: <p>I'm trying to figure out how to document two of my query parameters in OpenAPI.</p>
  <p><strong>Filtering</strong></p>
  <p>My filtering follows the recommendations of <a href="https://jsonapi.org/recommendations/#filtering" rel="noreferrer">JSON:API</a>, which takes the form of, for example:</p>
  <ul>
  <li><code>?filter[post]=1,2,3</code></li>
  <li><code>?filter[post]=1,2,3&amp;filter[author]=5</code></li>
  </ul>
  <p>The <code>filter</code> key is an associative array that can contain a set list of resource names in my API. The value assigned to each filter key is either a single id or list of comma separated ids.</p>
  <p><strong>Sorting</strong></p>
  <p>For sorting also follows the <a href="https://jsonapi.org/format/#fetching-sorting" rel="noreferrer">JSON:API recommendation</a>, so something like these:</p>
  <ul>
  <li><code>?sort=age</code></li>
  <li><code>?sort=age,-height</code></li>
  </ul>
  <p>The <code>sort</code> query parameter is assigned the value of one sort field or list of comma separated sort fields. Note that the minus sign that prefixes the <code>height</code> field indicates a descending sort.</p>
  <p><strong>Question</strong></p>
  <p>How do I represent the my <a href="https://jsonapi.org/format/" rel="noreferrer">filtering and sorting in OpenAPI</a>?</p>
  <p>For example, I'm not sure it's possible for me to specify that the filter key is an associative array, or that it accepts a comma separated list of ids. Almost the same issue for sort: how to represent a comma separated list of sort fields?</p>