-
Notifications
You must be signed in to change notification settings - Fork 678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No API descriptions with OWIN #94
Comments
Andreas, Have you enabled the project setting to output an XML Documentation file on build? Without this it just tells you that it is fetching the resource list. Aaron I'm using the latest MVC and Web Api 5.2.2 on IIS Express and Swashbuckler 4.1.0-rc2. I've tried to debug it and it comes down to this:
I saw a similar issue #57#57 , but that seemed more about calling swashbuckler's Init() twice. This is about having to call WebApiConfig.Register() twice, or more specifically, setting up the web api routes for both GlobalConfiguration.Configuration and OWIN's HttpConfiguration. I'm solely using Route attributes in my API controllers, but I also tried setting up a default API route and a test API controller with no route attributes. Have I misunderstood something about how ApiExplorer or how OWIN works? I know this is probably not a swashbuckler issue per se, but that is what I'm trying to use. Suggestions and insight are most welcome! [assembly: OwinStartup(typeof (Startup))] namespace InitialForce.LicenseService {
// Tried this too // var apiExplorer = new ApiExplorer(config); // config.Services.GetApiExplorer().d .Replace(typeof(IApiExplorer), apiExplorer); // And tried this // Swashbuckle.Bootstrapper.Init(config) // I've also tried not using app.Map()
— {"@context":"http://schema.org","@type":"EmailMessage","description":"View this Issue on GitHub","action":{"@type":"ViewAction","url":"https://github.com/domaindrivendev/Swashbuckle/issues/94","name":"View Issue"}}This message was scanned by ESVA and is believed to be clean. This message has been scanned for viruses and |
I have not, but note that I do get API descriptions and swagger working if I just call WebApiConfig.Register() in Global.asax.cs, so I don't think it's due to missing XML. Also I believe the XML is optional and only used for extra information? |
You are totally correct. I had a break point that skewed my quick test. |
Andreas, Here is the basic layout of my Startup class from a working webapi owin project.
|
Closing due to inactivity. If you haven't already, please look at this section of the readme - https://github.com/domaindrivendev/Swashbuckle#owin-self-hosted NOTE: For OWIN, or any hosting environment other than standard IIS, you should NOT install the full "Swashbuckle" package. You should just install the Core libraries and apply the manual bootstrapping steps as described in the readme. |
Thanks, I will try this on my next opportunity. It's been a long while since I touched the project where I tried this out. |
I'm using the latest MVC and Web Api 5.2.2 on IIS Express and Swashbuckler 4.1.0-rc2.
The web api is set up with OWIN and the only thing special is using app.Map(). See below.
I've read and followed all the setup instructions and troubleshooting tips.
I've tried to debug it and it comes down to this:
I saw a similar issue #57 , but that seemed more about calling swashbuckler's Init() twice. This is about having to call WebApiConfig.Register() twice, or more specifically, setting up the web api routes for both GlobalConfiguration.Configuration and OWIN's HttpConfiguration. I'm solely using Route attributes in my API controllers, but I also tried setting up a default API route and a test API controller with no route attributes.
Have I misunderstood something about how ApiExplorer or how OWIN works? I know this is probably not a swashbuckler issue per se, but that is what I'm trying to use. Suggestions and insight are most welcome!
The text was updated successfully, but these errors were encountered: