title: Swashbuckle/Swagger + ASP.Net Core: "Failed to load API definition"
body: <p>I develop an ASP.NET Core 2 application and included Swagger. Everything worked fine until I introduced a method without explicitly defining the HTTP action:</p>
  <pre><code>public class ErrorController : Controller
  {
      [Route(&quot;/error&quot;)]
      public IActionResult Index()
      {
          return StatusCode(500, new Error(&quot;Internal error.&quot;));
      }
  }
  </code></pre>
  <p>When I started the app with this method, the following message showed up:</p>
  <blockquote>
  <p>Failed to load API definition.</p>
  <p>Errors<br />
  Fetch error Internal Server Error /swagger/v1/swagger.json</p>
  </blockquote>
  <p>As soon as I explicitly set e.g. <code>[HttpGet]</code> the error disappears. The problem with this is, I need this method to fire for all possible HTTP operations.
  Of course, I could specify all operations explicitly, but I have the feeling Swagger should be able to handle this correctly.</p>
  <p>Why does Swagger behave this way?</p>
  <p>Is there any configuration I can use?</p>