title: Swagger - Web API - Optional query parameters
body: <pre><code>[HttpGet]
  [Route("students")]
  [SwaggerOperation(Tags = new[] { "Student" })]
  [SwaggerResponse(HttpStatusCode.OK, Type = typeof(ResponseModel&lt;IList&lt;Student&gt;&gt;))]
  [SwaggerResponseExample(HttpStatusCode.OK, typeof(StudentResponseExample))]
  [SwaggerResponse(HttpStatusCode.InternalServerError)]
  public IHttpActionResult SearchStudent()
      {
          IDictionary&lt;string, string&gt; searchParams = null;
          searchParams = ControllerContext.GetQueryStrings();
          .
          .
          .
  
      }
  </code></pre>
  
  <p>The above API has three optional parameters which will be pass as query string</p>
  
  <ol>
  <li>SyncDate - Long </li>
  <li>OffSet - int </li>
  <li>Limit - int</li>
  </ol>
  
  <p>There is no option for user to enter these optional query parameters in swagger UI. Please guide me to implement the optional query parameters.</p>
  
  <p>I am using swashbuckle and I prefer to use annotations rather than having a lengthy comment section over each API method for swagger functionalities.</p>
  
  <p>I referred the following <a href="https://stackoverflow.com/questions/35828328/adding-query-string-params-to-my-swagger-specs">Adding Query String Params to my Swagger Specs</a> and created the <strong>SwaggerParameterAttribute</strong> class in <strong>Filters</strong> folder of Web API and when trying to add the <strong>OperationFilter</strong> in  G<strong>lobalConfiguration.Configuration
                  .EnableSwagger</strong> as given, it throws type or the namespace name <strong>SwaggerParametersAttributeHandler</strong> could not be found. I even added the <strong>Filters</strong> folder namespace but still the error exists.</p>
  
  <p>Please guide on how to implement the optional query parameters in swagger</p>