title: Swagger Generate different documents for admin and regular users
body: <p>I currently have my solution set up to produce Swagger documentation for each end point. However I have several end points that are only available for admins. Down below you will be able to see an example. </p>
  
  <p>A regular user can create models, however only an admin can pull every single model in the database. </p>
  
  <p>The challenge is to generate 2 sets of swagger documentation? One for regular users to see, and another piece of documentation for Admin users to see. I know that if I add [ApiExplorerSettings(IgnoreApi = true)] to my end point it will not appear in the documentation generated however this would mean that my admin users wont be able to see that vital piece of documentation as well. Any recommendation on how to dynamically generate two sets of documents depending on the user will help. </p>
  
  <pre><code>[SwaggerResponse((int)System.Net.HttpStatusCode.OK, Type = typeof(RestOkResponse&lt;PackageResponse&gt;))]
  [SwaggerResponse((int)System.Net.HttpStatusCode.InternalServerError, Type = typeof(RestErrorResponse))]
  [SwaggerResponse((int)System.Net.HttpStatusCode.BadRequest, Type = typeof(RestErrorResponse))]
  [SwaggerResponse((int)System.Net.HttpStatusCode.Forbidden, Type = typeof(RestErrorResponse))]
  [SwaggerResponse((int)System.Net.HttpStatusCode.NotFound)]
  [HttpPost("/v1/packages")]
  [Authorize()]
  public async Task&lt;IActionResult&gt; CreateModel([FromBody]Request request)
  {
      ...
  }
  </code></pre>
  
  <p>The method below is for admins only:</p>
  
  <pre><code>[SwaggerResponse((int)System.Net.HttpStatusCode.OK, Type = typeof(RestOkResponse&lt;PackageResponse&gt;))]
  [SwaggerResponse((int)System.Net.HttpStatusCode.InternalServerError, Type = typeof(RestErrorResponse))]
  [SwaggerResponse((int)System.Net.HttpStatusCode.BadRequest, Type = typeof(RestErrorResponse))]
  [SwaggerResponse((int)System.Net.HttpStatusCode.Forbidden, Type = typeof(RestErrorResponse))]
  [SwaggerResponse((int)System.Net.HttpStatusCode.NotFound)]
  [ApiExplorerSettings(IgnoreApi = true)]
  [HttpPost("/v1/packages")]
  [Authorize()]
  public async Task&lt;IActionResult&gt; GetAllModelsFromDatabase([FromBody]Request request)
  {
      ...
  }
  </code></pre>