Generates Web API/ASP.NET Core controllers from a OpenAPI specification.
This package is source generator for great nswag tool. Inspired by H.NSwag.Generator
Install-Package ST.NSwag.ServerSourceGenerator
- Put openapi specification in project dir and add AdditionalFiles tag to project
<ItemGroup>
<AdditionalFiles Include="example.openapi.yaml" />
</ItemGroup>
or link specification outside project dir
<ItemGroup>
<AdditionalFiles Include="..\specs\linkedExample.openapi.yaml" Link="linkedExample.openapi.yaml" />
</ItemGroup>
- Add .nswag settings file in project dir with exact same name.
Example: example.openapi.yaml -> example.openapi.yaml.nswag
- How to generate or edit .nswag file?
Use NSwagStudio