8

Swashbuckle version="5.6.0" targetFramework="net451" generates "swagger": "2.0" spec.Is there any way to generate 3.0 spec?

In Asp.Net Core we can generate 3.0, what about in Asp.Net Framework WebApi?

Helen
  • 87,344
  • 17
  • 243
  • 314
abdulbasit
  • 1,856
  • 15
  • 17

2 Answers2

6

Unlike Swashbukle.AspNetCore, Swashbuckle for WebAPI does not support OpenAPI 3.0.

As a workaround, you can use Swashbuckle to generate a swagger: '2.0' definition and convert the generated file to OpenAPI 3.0 separately.

Helen
  • 87,344
  • 17
  • 243
  • 314
-1

Recommend the Nswag.

Key settings.

enter image description here

Edwin An
  • 14
  • 3
  • 9
    Please add code and data as text ([using code formatting](/editing-help#code)), not images. Images: A) don't allow us to copy-&-paste the code/errors/data for testing; B) don't permit searching based on the code/error/data contents; and [many more reasons](//meta.stackoverflow.com/a/285557). Images should only be used, in addition to text in code format, if having the image adds something significant that is not conveyed by just the text code/error/data. – Suraj Rao Sep 01 '22 at 08:23