Skip to content

TomWeps/SwaggerTraining

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swagger (OpenApi) & Tools - Usage Examples

Let's start with clarifying Swagger vs OpenApi

  • OpenAPI = Specification
  • Swagger = Tools for implementing the specification

Versions

Swashbuckle: Swagger Generator

MSDN: Get started with Swashbuckle and ASP.NET Core

Worth to know:

  • A lot of customization and extension possibilities - see Swagger Setup https://github.com/domaindrivendev/Swashbuckle.AspNetCore
  • [ProducesResponseType(StatusCodes.Status..., Type = typeof(IfAnotherTypeIsReturned))]
  • [Produces("application/json")] usually better set globally
  • Comments for actions and DTO objects
  • DataAnnotations can be used too (like required, default)
  • Other comment type - 'Example'
  • Enums Customizations
    • swagger Configuration DescribeAllEnumsAsStrings()
    • [JsonConverter(typeof(StringEnumConverter))]
    • [EnumMember(Value="CustomEnumStringValue")]

Manifest

Code Generators

Mocks

Others

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages