swashbuckle

What is Swagger and does it relate to OData?

痞子三分冷 提交于 2020-12-27 12:24:49
问题 I am familiar with the Microsoft stack. I am using OData for some of my restful services. Recently I came across Swagger for API documentation and I am trying to understand how it relates to OData. Both of them seem to be RESTful specifications. Which one is widely used? 回答1: Swagger is a specification for documenting APIs . By creating a swagger document for your API, you can pass it to an instance of Swagger UI, which renders the document in a neat, readable format and provides tooling to

Swashbuckle polymorphism support issue

最后都变了- 提交于 2020-12-12 11:56:32
问题 I am using Swashbuckle v3.0. I am not sure weather this is a bug or not, but polymorphism is not working as it should. I have the following classes: BasePersonDocumentDto { Id, Number } IdentityDto: BasePersonDocumentDto { } PassportDto: BasePersonDocumentDto { VisaNumber } To apply Inheritance & Polymorphism, i have created a schema and document filters. I followed this answer Below are the code i used. public class PolymorphismSchemaFilter<T> : ISchemaFilter { private List<Type>

Swagger: Dynamic Schema

女生的网名这么多〃 提交于 2020-12-12 07:35:04
问题 I'm having difficulty understanding the correct way to include validation information in a swagger file, when the validation logic can be dynamic (default, minValue, maxValue, etc.). Consider the following example: In a banking application, we a have a REST API for withdrawals. The withdrawal amount cannot be greater than the account value of the person taking the withdrawal. This value is going to depend on the context (Who's bank account we are withdrawing from) to get that maximum value.

Swagger: Dynamic Schema

女生的网名这么多〃 提交于 2020-12-12 07:33:42
问题 I'm having difficulty understanding the correct way to include validation information in a swagger file, when the validation logic can be dynamic (default, minValue, maxValue, etc.). Consider the following example: In a banking application, we a have a REST API for withdrawals. The withdrawal amount cannot be greater than the account value of the person taking the withdrawal. This value is going to depend on the context (Who's bank account we are withdrawing from) to get that maximum value.

Swagger: Dynamic Schema

允我心安 提交于 2020-12-12 07:33:12
问题 I'm having difficulty understanding the correct way to include validation information in a swagger file, when the validation logic can be dynamic (default, minValue, maxValue, etc.). Consider the following example: In a banking application, we a have a REST API for withdrawals. The withdrawal amount cannot be greater than the account value of the person taking the withdrawal. This value is going to depend on the context (Who's bank account we are withdrawing from) to get that maximum value.