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
10
votes
1 answer

Configuring Swashbuckle With DelegatingHandler as message dispatcher

I've got a Web API that is a really thin piece of infrastructure that contains nothing more than two DelegatingHandler implementations that dispatch incoming messages to message handler implementations that are defined in the business layer. This…
Steven
  • 166,672
  • 24
  • 332
  • 435
10
votes
5 answers

Modifications to Swagger UI header

I have created a personal WEB API using Swashbuckle and Swagger API. While I am able to integrate this successfully, I would like to modify the default UI for Swagger. Changing the color of the header and replacing the swagger image. Is this…
Richard
  • 381
  • 2
  • 4
  • 22
10
votes
1 answer

Remove a route with IOperationFilter in SwashBuckle

I am looking for a way to show/hide WebAPI routes in the Swagger documentation using SwashBuckle in a configurable way. Adding [ApiExplorerSettings(IgnoreApi = true)] will indeed hide the routes but I'd need to recompile every time I want that to…
LukeP
  • 1,505
  • 1
  • 16
  • 25
10
votes
3 answers

Unit Test Swagger Output

I am using Swagger in an ASP.NET MVC WebAPI project. This project has Swashbuckle nugget package installed and generates Swagger UI and Swagger/docs/v1. A consistent problem I'm having is developers will break the swagger file by not carefully…
Azure Terraformer
  • 1,648
  • 1
  • 14
  • 33
10
votes
3 answers

How do I add header documentation in Swashbuckle?

I am using the library Swashbuckle. Currently there is no stackoverflow tag for it. I don't quite understand the documentation here: https://github.com/domaindrivendev/Swashbuckle/blob/master/README.md The section titled "Describing…
LivingOnACloud
  • 1,151
  • 1
  • 11
  • 20
9
votes
2 answers

Serve multiple Swagger UIs on different URLs with single C# ASP.NET Core application

I need to serve multiple swagger UIs on single C# ASP.NET Core application. This is needed because application API consists of internal "private" API for UI and other stuff and "public" API that can be accessed by other applications and users. Each…
Aksim
  • 91
  • 1
  • 3
9
votes
1 answer

Swagger unexpected API PATCH action documentation of JsonPatchDocument in example request body

I'm making a Core 3.1 web API and using JsonPatch to create a PATCH action. I have an action named Patch which has a JsonPatchDocument parameter. Here is the action's signature: [HttpPatch("{id}")] public ActionResult Patch(int id,…
Lukas
  • 1,699
  • 1
  • 16
  • 49
9
votes
4 answers

.NET Core Web API, JWT and Swagger - 401 is showing as Undocumented instead of Unauthorized

I have an ASP.NET Core Web API 3 app that implements a REST API and uses a JWT bearer token for authorization, and Swagger (Swashbuckle). My controller has the [Authorize] filter on it,…
JoeD
  • 203
  • 1
  • 4
  • 8
9
votes
1 answer

Transitioning ISchemaFilter examples to Swashbuckle 5.0

Before Swashbuckle 5 it was possible to define and register a ISchemaFilter that could provide an example implementation of a model: public class MyModelExampleSchemaFilter : ISchemaFilter { public void Apply(Schema schema, SchemaFilterContext…
rheone
  • 1,517
  • 1
  • 17
  • 30
9
votes
3 answers

How can i specify the default opening version of swagger?

I have a C# web API that is using Swagger as API documentation. I have used the Swashbuckle packages. The swagger environment is working with multiple versions that i specify in the controllers. Today i introduced a new future version (1.2) that is…
Joris Mathijssen
  • 629
  • 7
  • 20
9
votes
0 answers

Does anyone know how to hide the client_id and client_secret on Available authorizations dialog in Swagger SwashBuckle?

I'm allowing customers to access my SaaS API via Swashbuckle. They are required to authenticate using OAuth via the Available authorizations popup. When they click the Authorize button via the popup they are required to authenticate via gmail.…
PatrickNolan
  • 1,671
  • 2
  • 20
  • 40
9
votes
1 answer

ASP.NET Core - Swagger - Public and private swagger pages

We have an API that contains some endpoints we want to expose publicly, and also some that we don't. However I don't simply want to exclude the private endpoints, I still want them to be visible, but only for certain users or at least under a…
QTom
  • 1,441
  • 1
  • 13
  • 29
9
votes
3 answers

C# Swashbuckle: Obsolete model property shows without change in swagger

I've marked a property as obsolete in my (input)model public class MyModel { [Obsolete("Use 'OtherProperty'")] public string SomeProperty {get;set;} public List OtherProperty {get;set;} } However, swagger shows no distinction…
remcolam
  • 505
  • 1
  • 5
  • 10
9
votes
3 answers

How to configure MultipleApiVersions in Swashbuckle using aspnet ApiVersioning

How do I configure swashbuckle to work with Aspnet API verisoning? https://github.com/Microsoft/aspnet-api-versioning In my Startup.cs I have the following code to initialize attribute based routing, api versioning, and swagger. var…
Zoop
  • 872
  • 3
  • 11
  • 24
9
votes
1 answer

How to add API description in Swashbuckle?

I'm new in Swashbuckl or Swagger but I've created a Web API which requires to create Documentation using Swagger from my client. I've already created but they require the API version details to be shown into the Swageer UI which I'm not so sure how…
barsan
  • 2,431
  • 16
  • 45
  • 62