Open griggsrl opened 7 years ago
I finally tracked down a little more info that might shed some light on this issue.
We use a 3rd party control in our application that it looks like hosts its own WebAPI instance in order to handle its own RESTful calls. The error described above occurs when a specific method of theirs is called during initialization of the webapp. I have contacted them to see if this call is required or what the ramifications of not making it might be.
However, here's a question: is there a way to have Swashbuckle ignore an assembly or class entirely? Since it's 3rd party we can't modify it to add custom attributes and using filters won't work as the exception is already thrown at that point.
Stackoflow link of the issue: http://stackoverflow.com/questions/43186510/swashbuckle-documentation-nullreferenceexception-on-load
Can someone please create a simple project reproducing this error?
Hi,
We're currently encountering a problem when trying to access our documentation. We currently host a WebAPI2 project in a Webforms web application which has worked well for us for nearly a year now. We are using Swashbuckle 5.2.2 but I did update to the current version to see if it would address the issue. It didn't happen to magically fix the issue so it is now reverted back to 5.2.2 since we're about to make a release.
A number of weeks ago all of a sudden the documentation started throwing exceptions when attempting to open it. The only information we've been able to gather so far is the following which is output to the browser:
We have identified the build at which it stopped working and have inspected the code commit that triggered the build. However, there were no commits to the WebAPI project at all, nor anything other than some CSS in the main webapp which wouldn't affect the Swagger documentation.
We have compared the web application folders between the two builds and the only differences other than the minor CSS differences are the project assemblies that got recompiled. Each build is built fresh from source control.
I've inspected the WebAPI2 project assembly and the custom swagger resource files (an image, html, and css file) are embedded correctly in both builds.
Here is our SwaggerConfig content (a few identifying names changed):
We aren't getting anything in the logs and walking through all of our code doesn't expose the error on our end.
Does anyone have any suggestions on how to further dig into this? We're kind of at a loss here since we can't capture where the error is coming from in the request routing. Any help would be appreciated.