title: Swashbuckle - use custom JSON schema for operation
body: <p>I have a specific case - I'm bulding an Azure Function endpoint that can take dynamic request payload, after that function is executed it takes the request body, and validates it against correct JSON schema that is stored somewhere in the storage.
  The schema is chosen based on the URL parameter.</p>
  <p>Here's a snippet of the function:</p>
  <pre class="lang-cs prettyprint-override"><code>[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(PublishResult))]
  [ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(PublishResult))]
  [FunctionName(&quot;Publish&quot;)]
  public async Task&lt;IActionResult&gt; Run(
      [HttpTrigger(AuthorizationLevel.Function, &quot;post&quot;, Route = &quot;publish/{eventType}&quot;)] HttpRequest req,
      [Blob(&quot;storage/{eventType}.json&quot;, FileAccess.Read)] Stream validationSchema,
      string eventType, ExecutionContext ctx)
  {
      JObject jResult;
      (isValid, error, jResult) = await ValidateRequestObject(req, eventType, validationSchema);
      if (!isValid)
      {
          _log.LogWarning(&quot;Invalid object. {Id}, {ObjectError}&quot;, id, error);
          return new BadRequestObjectResult(new PublishResult(id, error));
      }
  
      // function logic
  }
  
  </code></pre>
  <p>So my issue here is that I'd like to configure Swashbuckle so that it generates different request body based on these JSON schemas that I have. I can't figure out how to tell Swashbuckle to use my own custom JSON schemas for this.</p>
  <p>I know that it should probably be done by implementing IOperationFilter but I can't really get it right.
  I've found few cases that are similar but not quite what I'm looking for.</p>
  <p>Help would be much appreciated!</p>