daily pastebin goal
33%
SHARE
TWEET

Untitled

adamw00000 Jan 21st, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             services.AddSwaggerGen(c =>
  2.             {
  3.                 //The generated Swagger JSON file will have these properties.
  4.                 c.SwaggerDoc("v1", new Info
  5.                 {
  6.                     Title = "Swagger XML Api",
  7.                     Version = "v1",
  8.                 });
  9.  
  10.                 //Locate the XML file being generated by ASP.NET...
  11.                 var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
  12.                 var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
  13.  
  14.                 //... and tell Swagger to use those XML comments.
  15.                 c.IncludeXmlComments(xmlPath);
  16.             });
  17.         }
  18.        
  19.        
  20.        
  21.             app.UseSwagger();
  22.             app.UseSwaggerUI(c =>
  23.             {
  24.                 c.SwaggerEndpoint("/swagger/v1/swagger.json", "Swagger XML Api v1");
  25.             });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top