Created
June 10, 2018 06:58
-
-
Save wellingtonjhn/2268a10d57bb55b9b74046df6de0c899 to your computer and use it in GitHub Desktop.
Swagger XML Documentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void ConfigureServices(IServiceCollection services) | |
| { | |
| services.AddSwaggerGen(options => | |
| { | |
| // ... código omitido | |
| var applicationBasePath = PlatformServices.Default.Application.ApplicationBasePath; | |
| var applicationName = PlatformServices.Default.Application.ApplicationName; | |
| var xmlDocumentPath = Path.Combine(applicationBasePath, $"{applicationName}.xml"); | |
| if (File.Exists(xmlDocumentPath)) | |
| { | |
| options.IncludeXmlComments(xmlDocumentPath); | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment