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
0
votes
0 answers

Swashbuckle shows data type as string for classes in external library

I have a web project with a Web API 2 controller, and I added the Swashbuckle nuget package to it. When I access the swagger UI it displays my controller operations correctly. Web API Controller example: public class StatusEventController:…
jonny
  • 111
  • 2
  • 6
0
votes
0 answers

Swagger - make docs secure

I am using Swagger with the nuget swashbuckle package. It all seems to work ok. How do I keep it secure? I don't want anyone to be able to access Swagger docs by going to path-to-mysite/swagger. Note: I am using Azure too, so wondering if I can use…
raklos
  • 28,027
  • 60
  • 183
  • 301
0
votes
3 answers

Swagger and WebAPI (Swashbuckle) - making the /swagger endpoint private?

I just installed Swashbuckle in my WebAPI project and so far so good, though the /swagger api endpoint is public. I'd like to only allow access to my mobile app developer. How can I hide my API behind a password or require forms auth here?
RobVious
  • 12,685
  • 25
  • 99
  • 181
0
votes
0 answers

Does Swashbuckle and Swagger allow specifying maximum string lengths?

Using XML comments and auto discovery with Swashbuckle and Swagger for Web API 2, is it possible to decorate properties in such a way that information about maximum string length is shown in the swagger ui? For example, the below uses 'manual'…
Sentinel
  • 3,582
  • 1
  • 30
  • 44
0
votes
1 answer

Host Swashbuckle documentation on other Web site

I have Web-API enabled application hosted under IIS. I've added Swashbuckle to it and everything seems to work well. I'm able to access Swashbuckle documentation by api.cooldomain.com/swagger/ui/index Is it possible to host Swashbuckle documentation…
Jcomp
  • 13
  • 2
0
votes
0 answers

Error 500 : https://localhost:443/Cufx/swagger/docs/v1 when attempting to view the documentation

Folks, I get the following error when navigating to the documentation url. 500 : https://localhost:443/Cufx/swagger/docs/v1 I checked that the xml file is created and is in the proper destination path. I also confirmed that the app is also looking…
Skadoosh
  • 2,575
  • 8
  • 40
  • 53
0
votes
1 answer

How do you provide JSON examples in swashbuckler/swagger when your API method parameters have dynamic objects?

My WebApi has methods that look like the method below. Is there a way to provide input examples using Swashbuckler? public UserModel Login([FromBody] JObject data) { dynamic json = data; string sdkversion = (string)…
Webjedi
  • 4,677
  • 7
  • 42
  • 59
0
votes
3 answers

Swagger (Swashbuckle) on ASP.NET Core MVC targeting .Net Framework 4.6.1

I am migrating WebApi2 project to MVC6. As we have other dependencies written in .NET 4.6.1 we need to target same version. "frameworks": { "net461": {}} I have added dependencies: "Swashbuckle": "5.3.2", But the problem is that there is no way…
DrArqon
  • 153
  • 1
  • 11
0
votes
1 answer

How should I add authentication to swashbuckle?

I am using swashbuckle to add swagger to my asp.net mvc web api project. I see options to add OAuth2, but my website requires wsfederation. How can I require authentication to view the swagger ui with wsfederation? GlobalConfiguration.Configuration …
skalpin
  • 310
  • 1
  • 10
0
votes
1 answer

Seperate inputs for fields instead of a single body

Is it possible to have seperate textboxes for request fields in Swagger UI instead of a single Body textarea for the whole model?
dstr
  • 8,362
  • 12
  • 66
  • 106
0
votes
1 answer

Is there a way to flag stability of an API with Swagger

API stability index is important in API documentation, currently I am using Swashbuckle to document my API which is built with ASP.NET Web API, I want to ask is there a way to flag an API with API stability index such as "Stable", "Frozen" etc.
Shuping
  • 5,388
  • 6
  • 43
  • 66
0
votes
0 answers

Removing /api part from WebAPI path using a Reverse Proxy i.c.w. Swashbuckle

I am trying to configure an IIS hosted DotNet WebAPI with Swaschbuckle behind an Apache Reverse Proxy. Desired public urls should look something like: http://sub.domain.com/SomeAPI/Controller/Method http://sub.domain.com/SomeAPI/swagger Target…
sarvasana
  • 642
  • 4
  • 13
0
votes
1 answer

Can I configure Swagger UI to accept and empty array using Swashbuckle?

I have the following Web API action public IEnumerable Get([FromUri] int[] itemNumbers) itemNumbers are passed as ?itemNumbers=1&itemNumbers=2 I'm documenting it using Swashbuckle (Swagger). The API can accept an empty list (no item…
dommer
  • 19,610
  • 14
  • 75
  • 137
0
votes
0 answers

Swashbuckle custom header per method

If my method in my API looks for some custom property that is in the header, ie HttpContext.Current.Request.Headers.Exists("foobar"), is there a way for me to decorate that method so that Swashbuckle can generate that header for Swagger to test the…
hkf
  • 4,440
  • 1
  • 30
  • 44
0
votes
1 answer

The dependency WebActivatorEx could not be resolved

I am building a small web api and i wish to use Swagger ui to test it. However, when i install it, i get the following errors: DNX 4.5.1 error NU1001, in project.json: The dependency WebActivatorEx could not be resolved. DNX Core 5.0 error…
kodeaben
  • 1,829
  • 3
  • 24
  • 33