title: How to add x-code-samples for ReDoc with Swashbuckle.AspNetCore?
body: <p>What's the best way to add <a href="https://github.com/Rebilly/ReDoc/blob/master/docs/redoc-vendor-extensions.md" rel="nofollow noreferrer">x-code-samples</a> for <a href="https://github.com/Rebilly/ReDoc" rel="nofollow noreferrer">ReDoc</a> to swagger.json through <a href="https://github.com/domaindrivendev/Swashbuckle.AspNetCore#swashbuckleaspnetcoreannotations" rel="nofollow noreferrer">Swashbuckle.AspNetCore.Annotations</a>?</p>
  
  <p><strong>EDIT (March 30, 2019)</strong></p>
  
  <p>I hope this is a better explanation.
  There is a way in Swashbuckle.AspNetCore to add content to the generated swagger.json.</p>
  
  <p><strong>What's documented</strong>
  (Example from GitHub-Page):</p>
  
  <pre><code>[HttpPost]
  
  [SwaggerOperation(
      Summary = "Creates a new product",
      Description = "Requires admin privileges",
      OperationId = "CreateProduct",
      Tags = new[] { "Purchase", "Products" }
  )]
  public IActionResult Create([FromBody]Product product)
  </code></pre>
  
  <p><strong>About what I try to achieve</strong></p>
  
  <p>What I'd like to do is something like this:</p>
  
  <pre><code>[MyCustomSwaggerOperation(
      x-code-samples = [
          {
            "lang": "CSharp", 
            "source": "console.log('Hello World');"
          }, 
          {
            "lang": "php",
            "source": ...
          }
      ]
  )]
  public IActionResult Create([FromBody]Product product)
  </code></pre>