All Questions
Tagged with openapi swashbuckle
106
questions
0
votes
1
answer
105
views
Using JSON schema from external source in swagger in NET8 web API project
NET8 Web API project.
My controller actions don't have a typed input parameter. The incoming JSON is readed from request body stream and validated against the schema using NJsonSchema and sent either ...
0
votes
1
answer
122
views
Need to show dropdown in Azure Function Http Trigger with Open API Post Request
I need to show the options Hostname1, Hostname2 and Hostname3 in the below dropdown, but it is displaying options 0, 1 and 2. The code is written in Azure Function Http Trigger with Open API, .NET 6 ...
0
votes
1
answer
440
views
Create a Custom Attribute or Class for Swagger Documentation
I was wondering is there any way to create a custom class or attribute which I can call and keep all swagger documentation attributes at one place, for example This is my original code
[HttpGet]
[...
1
vote
0
answers
283
views
asp.net minimal API, validation of a primitive parameter, and OpenAPI documentation
I have working code but am hoping there is a better way...
Problem:
annotate a parameter in a method used in a minimal API in a way that informs OpenAPI (but does not mislead a future developer -- ...
0
votes
1
answer
36
views
path parameter not being populated from UI
I'm using Swashbuckle.AspNetCore 6.5.0
viewtype=full
widgetguid=940FFD66-A7C2-42F5-AAA2-153CBF9136EE
In Swagger UI when I execute an API call with both path parameters populated it produces this:
...
3
votes
1
answer
224
views
Using enums in routes
When using controllers you can use enums in routes but you have to add the following
builder.Services.AddControllers();
.AddJsonOptions(options =>
options.JsonSerializerOptions....
4
votes
0
answers
77
views
FormatException in NSwag for .NET When POST Method Has No Body
I'm encountering a FormatException in a .NET application using NSwag when calling a POST method without a body. The problematic endpoint is defined as follows:
[HttpPost]
[Route("AddUser/{id}&...
0
votes
1
answer
168
views
How to automatically generate an OpenAPI documentation from a jsonresult response?
Swashbuckle can automatically generates API documentation based on code (with details return model)
[HttpGet]
public ActionResult<List<Student>> GetStudents()
{
return ...
2
votes
1
answer
884
views
.NET Core using Swagger/OpenAPI to generate docs, how to generate in different languages?
I have a .NET Core Web API that is using OpenAPI/Swagger to generate the api endpoints. Is it possible for the page to support different languages (for example, I want my page to be in French and ...
1
vote
2
answers
679
views
Remove default "string" from swagger UI using .NET
Im using Swagger in .NET 5
After click on Try it out Swagger displays a "string" in the body. (Please see the below screenshot)
I want it to display "{}" instead.
That's what I ...
0
votes
1
answer
582
views
How to add second OpenAPI document to swagger UI when using [ApiExplorerSettings(GroupName = "CustomApiGroup")]
How do I add second definition to swagger UI in ASP.NET Core?
I unterstand that using GroupName property of ApiExplorerSettingsAttribute I can create separate OpenApi document:
[ApiExplorerSettings(...
2
votes
1
answer
498
views
How to send a fixed header value without showing it in Swagger UI?
can I add a custom header, and then in the Swagger UI interface the API call is asking this header as a parameter. But I actually just want to send it with the call hardcoded, without the possibility ...
0
votes
1
answer
586
views
Swagger, ignore property when generating actions. To resolve conflict for Property Type
I am using Swashbuckle 5.6.3 on ASP.Net Core.
I'm getting this error:
Failed to generate Operation for action
Tracing the problem, it is because I have a conflict on the property type of the response:
...
0
votes
1
answer
404
views
ApiExplorerSettings(IgnoreApi=true) doesn't hide mapping routes from document
I expect this couple routes to be hidden because of ApiExplorerSettings(IgnoreApi=true)
app.MapPost("/login", [ApiExplorerSettings(IgnoreApi=true)] async (string returnUrl, HttpContext ...
0
votes
0
answers
542
views
how to ignore the certain models generated in swagger ui schemas section
I have .net solution with multiple projects and some of them have controllers in it.
I found a way to generate the endpoints with only desired route (ex: swaggerDoc.Paths.Contains("someapi/")...