What's the best way to add x-code-samples for ReDoc to swagger.json through Swashbuckle.AspNetCore.Annotations?
EDIT (March 30, 2019)
I hope this is a better explanation. There is a way in Swashbuckle.AspNetCore to add content to the generated swagger.json.
What's documented (Example from GitHub-Page):
[HttpPost]
[SwaggerOperation(
Summary = "Creates a new product",
Description = "Requires admin privileges",
OperationId = "CreateProduct",
Tags = new[] { "Purchase", "Products" }
)]
public IActionResult Create([FromBody]Product product)
About what I try to achieve
What I'd like to do is something like this:
[MyCustomSwaggerOperation(
x-code-samples = [
{
"lang": "CSharp",
"source": "console.log('Hello World');"
},
{
"lang": "php",
"source": ...
}
]
)]
public IActionResult Create([FromBody]Product product)