Skip to main content

All Questions

Tagged with
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 ...
aleha_84's user avatar
  • 8,509
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 ...
HarshSharma's user avatar
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] [...
Pankaj's user avatar
  • 2,724
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 -- ...
Stand__Sure's user avatar
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: ...
user195166's user avatar
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....
Peter's user avatar
  • 38.3k
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}&...
SepanD's user avatar
  • 137
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 ...
GinCanhViet's user avatar
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 ...
user avatar
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 ...
K.W's user avatar
  • 151
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(...
Liero's user avatar
  • 27.2k
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 ...
Navorski's user avatar
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: ...
Jamie Hartnoll's user avatar
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 ...
anatol's user avatar
  • 1,732
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/")...
userahd's user avatar
  • 55

15 30 50 per page
1
2 3 4 5
8