Created
February 27, 2017 21:54
-
-
Save romipetrelis/6c4eba79d961408189324a54f2ea96b7 to your computer and use it in GitHub Desktop.
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
private static void ConfigureSwagger(HttpConfiguration config) | |
{ | |
config.EnableSwagger( | |
c => { | |
c.SingleApiVersion("all", "Some API"); | |
c.IncludeXmlComments(string.Format(@"{0}\bin\Your.Assembly.XmlComments.xml", | |
AppDomain.CurrentDomain.BaseDirectory)); | |
c.RootUrl(req => | |
req.RequestUri.GetLeftPart(UriPartial.Authority) + | |
req.GetRequestContext().VirtualPathRoot.TrimEnd('/')); | |
}) | |
.EnableSwaggerUi(c => { | |
c.DisableValidator(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment