RicoSuter / NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
http://NSwag.org
MIT License
6.69k stars 1.24k forks source link

Extension Examples #2469

Open acds opened 4 years ago

acds commented 4 years ago

Hi @RicoSuter et al

Are there any plans to provide some samples for implementing document extensions.

Given a trawl of the Issues (Closed/Resolved and Open) I've not been able to find a good starting point.

Essentially I'm looking to extend the OpenApiDocument generation to emit additional definition dynamically to support x-amazon-apigateway-integration, x-amazon-apigateway-api-key-source to emit CORS specifications for each method.

Perhaps these are useful specific examples to get documented and would be happy to share a specific sample such that other could use it as a starting point for their AWS API Gateway integration?

Additional I'd only want to emit this in a document, not in the UI.

Any hints or examples to start from would be greatly appreciated, as I continue to migrate to using NSwag to generate the OpenAPI specification.

Thanks

RicoSuter commented 4 years ago

See https://blog.rsuter.com/nswag-tutorial-implement-a-custom-operation-processor-to-define-redoc-code-samples/