Forum Discussion

waltsbjr's avatar
waltsbjr
Occasional Visitor
5 years ago

Not showing methods

I had implemented swagger in my .net 4.6 api but it load the swagger but not showing any controller method.
The json file not showing any path also.

My project contains owin security and JWT framework. 

config
      .EnableSwagger(c =>
{
  c.SingleApiVersion("v1", "IntegApi");
  c.IncludeXmlComments(GetXmlCommentsPath());
  c.UseFullTypeNameInSchemaIds();
  c.RootUrl(req => "http://localhost:53540");
  c.PrettyPrint();
  c.ApiKey("apiKey")
  .Description("ACPNET")
  .Name("client_id")
  .In("header");   
})
  .EnableSwaggerUi(c =>
  {
     c.DocExpansion(DocExpansion.None);
     c.EnableApiKeySupport("client_id", "header");
 });

And json:

{
  "swagger": "2.0",
  "info": {
    "version": "v1",
    "title": "IntegApi"
  },
  "host": "localhost:53540",
  "schemes": [
    "http"
  ],
  "paths": {},
  "definitions": {},
  "securityDefinitions": {
    "apiKey": {
      "type": "apiKey",
      "description": "ACPNET",
      "name": "client_id",
      "in": "header
    }
  }
}




 

Thank you!

 

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Hi waltsbjr,

     

    This looks like an issue with Swashbuckle (.NET library that your app uses to add Swagger UI). Swashbuckle is not our project and we don't know it well enough to provide guidance. Your best bet is to go through the Swashbuckle documentation at https://github.com/domaindrivendev/Swashbuckle, and if no information is available, file a ticket with that project for further support.