title: How to ask for additional GET parameters in an endpoint of api-platform using swagger docs?
body: <p>I have a symfony project, where I use api-platform.</p>
  <p>I have an entity, and I have data providers for it. I am in trouble with definition of additional parameters for a collection endpoint.</p>
  <p>An entity is called suggestion. It has to return collection of documents from elastic search.</p>
  <p>An endpoint is:</p>
  <pre><code>/suggestion
  </code></pre>
  <p>This endpoint listens to additional GET parameters:</p>
  <blockquote>
  <p>page, level</p>
  </blockquote>
  <p>These two params are read each time, when the endpoint is requested.</p>
  <p>In my <code>SuggestionsCollectionDataProvider.php</code> class I have:</p>
  <pre><code>/**
       * Retrieves a collection.
       *
       * @param string $resourceClass
       * @param string|null $operationName
       * @return \Generator
       */
      public function getCollection(string $resourceClass, string $operationName = null): \Generator
      {
          $query = $this-&gt;requestStack-&gt;getCurrentRequest()-&gt;query;
          // I am reading these two parameters from RequestStack
          
          // this one is built-in
          $page = max($query-&gt;get('page', 1), 1); 
  
          // this is a custom one
          $level = $query-&gt;get('level', 0); 
          ...
  </code></pre>
  <p>In my <code>SuggestionRepository.php</code> class:</p>
  <pre><code>/**
       * @return \Generator
       */
      public function find(int $page, int $level): \Generator
      {
          // here I can process with $level without problems
  </code></pre>
  <p><strong>Page</strong> parameter is default parameter, that is generating in swagger for collections.</p>
  <p>A screenshot from API platform generated Swagger doc:</p>
  <p><a href="https://i.stack.imgur.com/CDut5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/CDut5.png" alt="enter image description here" /></a></p>
  <p>But the <strong>page</strong> parameter is now <strong>the only parameter</strong>, that can be edited in web version.</p>
  <p><strong>I need to add more parameters (<code>level</code> in this case) to swagger</strong> and describe them, so the user/tester knows which parameter actually goes to this endpoint.</p>
  <h2>Main question:</h2>
  <p><strong>How to tell api-platform, that I want a user/tester of the API (from client side) to enter some other parameters, i.e. <code>level</code> for example?</strong></p>