Questions tagged [swashbuckle.examples]
21 questions
4
votes
2 answers
Swashbuckle MapType doesn't work with parameters
I've got an API endpoint that takes a ShortGuid class as a parameter, like such:
[HttpGet("api/endpoint")]
public async Task GetTablesAsync(ShortGuid id){}
Generates a swagger definition of:
"parameters":[
{
…

Michael Brown
- 1,585
- 1
- 22
- 36
3
votes
2 answers
SwaggerRequestExample attribute does not work in ASP.NET MVC 5 (.NET Framework 4.5.2)
I am toying with Swashbuckle.Examples package (3.10.0) in an ASP.NET MVC project. However, I cannot make request examples appear within the UI.
Configuration (SwaggerConfig.cs)
public static void Register()
{
var thisAssembly =…

Alexei - check Codidact
- 22,016
- 16
- 145
- 164
2
votes
1 answer
How to remove application/json from Swagger-UI included in Swashbuckle for asp.net
I have an asp.net .net framework (not core) where I am using Swashbuckle to auto generate the Swagger documentation for my API.
I have also added Swashbuckle examples.
I want to use the SwaggerResponseExample to show example return data, but in the…

peterc
- 6,921
- 9
- 65
- 131
2
votes
0 answers
Swashbuckle Description doesn't show up for properties with User Defined Types
Swashbuckle is not picking up the description while generating Swagger Json for properties with class types. It works fine with primitive data types.
for ex in below code, both of the definitions show up in xml file but only field with type string…

user1324887
- 632
- 3
- 11
- 32
2
votes
2 answers
Sorting the Schemas portion of a Swagger page using Swashbuckle
On my Swagger page, I am (mostly) able to order the operations as described on the Swashbuckle page.
Below the operations is a "Schemas" section showing the data structures used by the actions. These data structures appear in a arbitrary order. I…

Timothy
- 41
- 1
- 5
1
vote
0 answers
Swashbucke Date example showing time component/wrong format
We specify an input property with an example value as such
///
/// Start date in format YYYY-MM-DD
///
/// 2020-05-31
[DataType(DataType.Date)]
public DateTime? From { get; set; }
And produces the following…

ilen
- 69
- 8
1
vote
1 answer
Swagger/Swashbuckle Example limited to one example pr request object?
I've been struggling with making swagger request examples using Swashbuckle, because I have several endpoints that uses the same request model. I make multiple examples, applying the correct ones to each endpoint, but only one of the examples will…

robertpaulsen
- 209
- 4
- 9
1
vote
1 answer
Azure Pipeline - build and gen swagger doc
My project is an AspNet Core 2.2 Api, I am building it in Azure Pipelines (classic) I want to generate the swagger document during an azure pipeline build - for this I am using Swashbuckle.AspNetCore.Cli and the documents in Retrieve Swagger…

Sherif Botros
- 105
- 1
- 7
1
vote
0 answers
How to add example for POST body for swagger using Asp .Net Core
I am using .Net Core 2.2 and swagger 2.0. I want to add an example body as a part of the documentation for the POST operation. I could not find any support for "POST" with a body in Swashbuckle.AspNetCore.
How to add documentation for POST body…

user1748546
- 97
- 2
- 11
1
vote
1 answer
Swagger-net (or swashbuckle) : how to set the namespace in the xml requests?
is there a way to generate example requests with xml namespaces using Swagger-net? Or in swashbuckle?
I was thinking of something like:
[SwaggerResponseExample(HttpStatusCode.OK,
typeof(ResponseExample), xmlnamespace="wanted xml namespace goes…

Schattenjäger
- 331
- 1
- 3
- 13
1
vote
1 answer
Add Authorize Attribute Filter in Swashbuckler Implementation of Swagger
Looking to add the AuthorizeFilterAttribute or AnonymousFilterAttribute to an endpoint in Swashbuckle's implementation of Swagger so I can see which attribute is used on each endpoint in the generated documentation file in a running webapi that ends…

RetroCoder
- 2,597
- 10
- 52
- 81
0
votes
1 answer
Swashbuckle Example Data Type not showing correct markup
I am trying to get my SwashBuckle/Swagger GUI to show the correct elements based on how I set it in code. Currently the example output looks like this:
<_Somes>
<_SomeID>string
…

user21908362
- 1
- 3
0
votes
0 answers
why swashbuckle not showing request schema link in my .net 6 web api project?
I use swashbuckle to generate a swagger page. In response part, I can see schema link:
But at the request part, I only see example, but not schema link:
This is my c# code
[HttpPost]
[ApiVersion("2.0")]
…

daxu
- 3,514
- 5
- 38
- 76
0
votes
1 answer
Swashbuckle.AspNetCore not working for me
I am trying to set up examples using tag but, it is not working for me. I am using Swashbuckle.AspNetCore library.
Some code samples are below,
Added the following to my csproj.…

tRuEsAtM
- 3,517
- 6
- 43
- 83
0
votes
0 answers
Adding sample value for a list of strings
How do I create sample value for a list of strings in Swagger.
It works for all fields except the one with a list of strings.
This is what I have :
public class Request
{
/// TEST123
public string Name { get; set; }
…

user7849697
- 503
- 1
- 8
- 19