-
-
Save justinyoo/44845d980dfe2ef77942 to your computer and use it in GitHub Desktop.
API Management Tips & Tricks
This file contains 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 static void ConfigureServices(this IServiceCollection services) | |
{ | |
... | |
services.AddSwaggerGen(); | |
services.ConfigureSwaggerDocument( | |
options => | |
{ | |
options.SingleApiVersion(new Info() { Version = "v1", Title = "Swagger UI" }); | |
options.IgnoreObsoleteActions = true; | |
options.OperationFilter(new ApplyXmlActionComments(GetXmlPath(appEnv))); | |
options.DocumentFilter<SchemaDocumentFilter>(); | |
}); | |
services.ConfigureSwaggerSchema( | |
options => | |
{ | |
options.DescribeAllEnumsAsStrings = true; | |
options.IgnoreObsoleteProperties = true; | |
options.CustomSchemaIds(type => type.FriendlyId(true)); | |
options.ModelFilter(new ApplyXmlTypeComments(GetXmlPath(appEnv))); | |
}); | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment