arjun-g / vs-swagger-viewer

Swagger Viewer lets you preview and validate Swagger 2.0 and OpenAPI files as you type in Visual Studio Code.
MIT License
169 stars 47 forks source link

Swagger examples support #78

Closed skryvets closed 4 years ago

skryvets commented 4 years ago

OAS 2 and 3 supports examples where you can see request/response samples, illustrate different options for query params and other possibilities.

Here's screenshot that demonstrates UI dropdown to select from

https://user-images.githubusercontent.com/1156160/60561206-b68aa580-9d8d-11e9-9c3f-4b1a83ab895d.png

Are there any plans to support it? I utilize it heavily in my projects. Thank you.

JSchoreels commented 4 years ago

Looks like it needs to use UI version >= 3.23 (https://swagger.io/docs/specification/adding-examples/)

Dependencies are : "swagger-ui-dist": "^3.22.0"

bruha commented 4 years ago

While MR is waiting to be merged, you can bump "swagger-ui-dist" version locally: run in terminal $ cd ~/.vscode/extensions/arjun.swagger-viewer-2.2.2 $ nano package.json change "swagger-ui-dist": "^3.22.0", to "swagger-ui-dist": "^3.25.0", run $ npm i

Observe Swagger examples 😎

arjun-g commented 4 years ago

Fixed in version 3.0.0. swagger-ui-dist upgraded to 3.25.2