Linked Questions

0 votes
0 answers
29 views

How to hide a request field in Swagger with .Net Web API on GET Request [duplicate]

There are multiple solutions for hiding a model property from swagger if you're sending data via Body with POST request. But in Get Request None of the solutions work. For Example : Creating a new ...
Kadir Kalkan's user avatar
4 votes
5 answers
19k views

Ignore Property From Swagger UI

I'm trying to ignore property on swagger UI. based on this article I have implemented a Filter and tried [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] public class ...
Gayan's user avatar
  • 2,800
8 votes
3 answers
1k views

ASP.NET Core - System.Text.Json: how to reject unknown properties in payload?

Web API in ASP.NET Core 7 with System.Text.Json: I need to reject JSON payloads on PUT/POST APIs which have additional properties specified which do not map to any properties in the model. So if my ...
silent's user avatar
  • 15.4k
2 votes
1 answer
4k views

How to exclude certain model from Swagger UI

I have a model that's being used by one of the other models, that is being accepted as a parameter to one of my controllers. So as a result, this model is being displayed in Swagger UI. This model is ...
OhWelp's user avatar
  • 197
4 votes
2 answers
2k views

How to configure Swashbuckle to omit Template / Entity / Schema from the documentation

I'm trying to build a filter for Swashbuckle to omit in the API documentation the models / Entities / Schema of the project, keeping the controllers. The technology employed is Swashbuckle.AspNetCore ...
Nathalino Pachêco's user avatar
0 votes
1 answer
3k views

How can I tell Swagger to not show certain fields in my input class as parameters?

I have an api app where the controller method takes a class as input. I'm using Swagger to show the user what variables are in that class. I used the class for other purposes so for certain methods ...
boilers222's user avatar
  • 1,939
0 votes
1 answer
2k views

How to exclude property in Request payload in swagger

I have below Endpoint in ASP.Net Core 2.1 with EF Core 2.1 public class CustomerController { public IActionResult Post([FromBody]CustomerTO customer) { } public IActionResult Get(...
Kgn-web's user avatar
  • 7,327
2 votes
1 answer
2k views

Ignore [FromForm] data from rendering on swagger

I am working on .Net 5 Web API and I am using Swashbuckle, when I used [JsonIgnore] on my model it works fine for rendering my JSON Model : public partial class ApplicationDocument : BaseModel ...
esamaldin elzain's user avatar
0 votes
1 answer
1k views

How to display body as html forms using Swagger in ASP.NET Core

In Swagger is it possible to have the body represented as HTML forms as opposed to a JSON string? and how would one achieve this? In django for example I can input the JSON via html forms (Yes this is ...
Soggy's user avatar
  • 152
1 vote
1 answer
1k views

How to configure Swashbuckle to ignore property on model for a specific api version only

I needed to add a property to a model and I have implemented what is suggested in the selected answer here and it's working in that it removes the property I have tagged with ...
subzero's user avatar
  • 33
1 vote
1 answer
676 views

Exclude specific properties of a class property from another class to avoid circular reference

I have a freezing issue with Swashbuckle Swagger UI on some of our endpoints. This looks to be an issue with circular references. After some research, I still couldn't find a fix. I found this SO ...
xGeo's user avatar
  • 2,149
0 votes
1 answer
830 views

ASP.NET Core - How to ignore model bound property of complex type in Swagger UI

Instead of using a bunch of different parameters in a controller method, I want to consolidate all parameters to one class. Additionally, environment parameters will be collected from HttpContext and ...
M. Koch's user avatar
  • 715
1 vote
0 answers
601 views

How to ignore class typed propery from schema in swagger.json

I am using ASP NET Core 5 and Swashbuckle 6.1.4 I configured new SchemaFilter according this answer. So here is my example class: public class ExampleClass { public int Id { get; set; } ...
Mateech's user avatar
  • 1,059
1 vote
0 answers
445 views

Swashbuckle - Handling Jsonignore so model properties do not show

I am currently using Swashbuckle NET CORE with an ASPNET Core project and can't get the Jsonignore property on my ApiModels to be ignored from swagger. I have a situation when some of the properties ...
dreza's user avatar
  • 3,605
2 votes
0 answers
410 views

Swashbuckle.AspNetCore: Exception thrown when using a Func<T> in the request (even with the [BindNever] attribute)

The following model makes Swashbuckle throw an exception when it tries to generate the document. Please, notice that I'm decorating the properties Predicate and OrderParts with the [BindNever] ...
EmilioV's user avatar
  • 244

15 30 50 per page