Questions tagged [swashbuckle]

Swashbuckle is an open source framework which adds Swagger and Swagger-ui to ASP.NET Web API projects.

Swashbuckle combines ApiExplorer, Swagger and Swagger-ui to provide a rich discovery, documentation and playground experience to your ASP.NET Web API consumers.

Core features:

  • Auto-generated Swagger 2.0
  • Seamless integration of swagger-ui
  • Reflection-based Schema generation for describing API types
  • Extensibility hooks for customizing the generated Swagger doc
  • Extensibility hooks for customizing the swagger-ui
  • Out-of-the-box support for leveraging Xml comments
  • Support for describing ApiKey, Basic Auth and OAuth2 schemes ... including UI support for the Implicit OAuth2 flow

The Swashbuckle tag should be used for questions about:

  • Configuring Swashbuckle
  • Extending Swashbuckle with the interfaces ISchemaFilter, IOperationFilter and IDocumentFilter
  • Customizing the embedded Swagger-UI

Questions specifically addressing Swagger or Swagger-UI should not be tagged with the Swashbuckle tag.

Source code: https://github.com/domaindrivendev/Swashbuckle

1366 questions
17
votes
4 answers

Replace Swashbuckle UI completely

Right now I'm developing an ASP.Net Web API and using Swashbuckle for its documentation. I know that Swashbuckle use Swagger-UI internally, I know that we can modify the layout by injecting our css or javascript file, even change the layout of…
Martin Valentino
  • 1,002
  • 2
  • 11
  • 26
16
votes
2 answers

System.Text.Json Field Serialization in .NET 5 not shown in Swashbuckle API Definition

Problem I'm using ASP.NET Core with .NET 5 and am using the System.Text.Json serializer to serialize types containing fields (like System.Numerics.Vector3 (X, Y and Z are fields), although any type with fields behaves the same here). I've verified…
blenderfreaky
  • 738
  • 7
  • 26
16
votes
4 answers

How can I tell Swashbuckle that the body content is required?

I have a WebAPI controller that accepts binary packages and stores them somewhere. As these packages can become quite large, I don't want to load them into memory by adding a byte array parameter but rather pass along a stream. I found a way to do…
Daniel Sklenitzka
  • 2,116
  • 1
  • 17
  • 25
16
votes
2 answers

Rename model in Swashbuckle 6 (Swagger) with ASP.NET Core Web API

I'm using Swashbuckle 6 (Swagger) with ASP.NET Core Web API. My models have DTO as a suffix, e.g., public class TestDTO { public int Code { get; set; } public string Message { get; set; } } How do I rename it to just "Test" in the generated…
ultravelocity
  • 2,099
  • 16
  • 17
16
votes
7 answers

How to replace Swagger UI header logo in Swashbuckle

I am using the Swashbuckle package for WebAPI and am attempting to customize the look and feel of the swagger ui default page. I would like to customize the default swagger logo/header. I have added the following to SwaggerConfig .EnableSwaggerUi(c…
Abhijeet Patel
  • 6,562
  • 8
  • 50
  • 93
16
votes
1 answer

Hard Coding Api Key value in header when using a Swagger Generated Client

I have written many APIs in C# and created a "Swagger" documentation website using Swashbuckle. For Authenticate REST calls I use an API Key in the header. I created a page that permits to download a specific client for any programming language as…
Luca Natali
  • 349
  • 6
  • 17
16
votes
9 answers

How to add line break to Swashbuckle documentation?

I'm generating documentation for an api implemented in Web Api 2 using swagger/swashbuckle. The only xml documentation tags recognized are the , and . This means I cannot use tag to format my text in new lines or…
Attila Szasz
  • 3,033
  • 3
  • 25
  • 39
15
votes
5 answers

Disable "Try It Out" in Swagger

This question has been asked a lot for different languages. After a substantial amount of (fruitless) browsing Im feeling rather dumb but, I'll ask anyway This document refers to adding a Swagger plugin in what appears to be…
Jimbo
  • 22,379
  • 42
  • 117
  • 159
15
votes
3 answers

Swagger not working correctly with multiple versions of ASP.NET WebApi app

Please help me with this, it looked easy at first, now I'm late in the project: I'm trying to setup API versioning for a ASP.NET WebApi project, along with Swagger. The API versioning works fine, calling different versions returns the correct…
Sorin Comanescu
  • 4,829
  • 3
  • 29
  • 38
14
votes
2 answers

Swagger Swashbuckle Asp.NET Core: show details about every enum is used

I have the following enum: public enum TicketQuestionType { General = 1, Billing = 2, TMS = 3, HOS = 4, DeviceManagement = 5 } and model class: public class TicketCreateApi { public string Subject { get; set; } public…
14
votes
4 answers

Swagger UI for net core 3.1 api is very slow

I updated Our net core API application from 2.1 to 3.1, SwashBuckle.Asp.NetCore to 5.0.0. Here is my startup set: public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public…
user3097695
  • 1,152
  • 2
  • 16
  • 42
14
votes
1 answer

How to document API Key authentication using Swashbuckle.AspNetCore v5.0.0-rc2

I am migrating a Web API that has Swagger documenation generated using Swashbuckle from .NET Framework to ASP.NET Core. In the new AspNetCore version I'm using Swashbuckle.AspNetCore v5.0.0-rc2. This is an internal service and authentication uses…
Joe
  • 122,218
  • 32
  • 205
  • 338
14
votes
3 answers

SwaggerUI not adding ApiKey to Header with Swashbuckle (5.x)

I am using Swashbuckle.AspNetCore 5.0.0 to generate Swagger documentation for my .Net Core WebApi project, and for the most part, everything is going fine. I have set up some simple authentication using ApiKey, and that is working good. Where I am…
Justin Greywolf
  • 650
  • 7
  • 17
14
votes
4 answers

How can I change order the operations are listed in a group in Swashbuckle?

I'm using Swashbuckle to generate Swagger UI. It has options for choosing a grouping key (controller by default) and the ordering of the groups, but I would like to choose an order for the operations in a group so that GET appears always before…
lpacheco
  • 976
  • 1
  • 14
  • 27
14
votes
2 answers

Add Authentication to /swagger/ui/index page - Swagger | Web API | Swashbuckle

I'm working on a Swagger (Web API) project. When I first run the application it shows the Login page for Swagger UI. So, a user first has to login to access Swagger UI Page, However, if user directly enters "http://example.com/swagger/ui/index"…
GorvGoyl
  • 42,508
  • 29
  • 229
  • 225