No API descriptions with Swashbuckle 5.0 and OWIN
See original GitHub issueI’ve read the documentation on Swashbuckle 5.0 and the only thing we have to do is to enable Swagger and SwaggerUI via Swashbuckle.Core. The /swagger/ui/index shows up but with no descriptions…
Here is my Startup.cs :
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
ConfigureWebApi(app);
RegisterSwagger(app);
}
}
Here is my Startup.SwaggerConfig.cs :
public partial class Startup
{
public static void RegisterSwagger(IAppBuilder app)
{
GlobalConfiguration.Configuration
.EnableSwagger(c =>
{
c.SingleApiVersion("v1", "MyAPI");
c.IncludeXmlComments(GetXmlCommentsPath());
})
.EnableSwaggerUi();
}
protected static string GetXmlCommentsPath()
{
return System.String.Format(@"{0}\bin\MyAPI.XML", System.AppDomain.CurrentDomain.BaseDirectory);
}
}
Did I miss something?
I’ve make some research on that issue and it seems that with Swashbuckle 4.0 there was an
Swashbuckle.Bootstrapper.Init(config);
Is it replaced with something else?
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
No API descriptions with Swashbuckle 5.0 and OWIN #196
I've read the documentation on Swashbuckle 5.0 and the only thing we have to do is to enable Swagger and SwaggerUI via Swashbuckle.Core....
Read more >Swashbuckle 5 can't find my ApiControllers
I'm not sure if the XML docs working/not-working has anything to do with it though, as I get absolutely no controllers on the...
Read more >Swashbuckle.WebApi
When you host Web API 2 on top of OWIN/SystemWeb, Swashbuckle cannot correctly resolve VirtualPathRoot by default. You must either explicitly set ...
Read more >How to Setup Swagger in Web API ASP.NET ...
Since we are using Owin Configuration there is now a simple command that needs to be called SwaggerConfig.Register(config); . This will call the ......
Read more >ASP.NET Web API Documentation using Swagger
Short tutorial which shows how to add ASP.NET Web API documentation using Swagger and Swashbuckle.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, I have managed to configure Swagger inside OWIN Startup class:
And in SwaggerConfig,cs:
Thanks @corneliu-serediuc this handled my problem. The actual nuget package uses [assembly: PreApplicationStartMethod(typeof(SwaggerConfig), “Register”)] which only works when the project isn`t based on OWIN. If you comment this attribute out, and call the Register from the Startup.cs the methods get discovered just fine… Thanks!