title: Net Core API: Make ProducesResponseType Global Parameter or Automate
body: <p>We have 100+ APIs and have to write ProducesResponseType for all our APIS at the top, 200, 500, etc. Is there a method to make this global parameter for all our get functions, so we don't have to continue repeating code? Trying to make APIs follow Dry principle and be thin controllers.</p>
  
  <pre><code>[HttpGet("[Action]/{id}")]
  [ProducesResponseType(typeof(GetBookResponse), StatusCodes.Status200OK)]
  [ProducesResponseType(StatusCodes.Status404NotFound)]
  [ProducesResponseType(typeof(GetBookResponse), StatusCodes.Status500InternalServerError)]
  public async Task&lt;ActionResult&lt;GetBookResponse&gt;&gt; GetByBook(int id)
  {
     var book = await bookservice.GetBookById(id);
     return Ok(book);
  }
  </code></pre>
  
  <p><strong>Resources:</strong> </p>
  
  <p><a href="https://stackoverflow.com/questions/43153621/set-one-producesresponsetype-typeof-for-several-httpstatuscodes">Set one ProducesResponseType typeof for several HttpStatusCodes</a></p>
  
  <p><a href="https://stackoverflow.com/questions/57678813/net-core-api-purpose-of-producesresponsetype">Net Core API: Purpose of ProducesResponseType</a></p>