Swagger does not work correctly when I use custom ContractResolver

Viewed 237

I used swagger to show comments and it worked perfectly.

But when I wrote a custom ContractResolver for a class. swagger did not show any information about this class. It is obvious because swagger use my ContractResolver.

services.AddControllers().AddNewtonsoftJson(Options=>Options.SerializerSettings.ContractResolver = new CustomContractResolver(services));

Now I want to know, are there any solutions to solve this problem. For example, for swagger use default ContractResolver and for other reasons use my custom ContractResolver.

0 Answers
Related