Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
arjun-g committed Aug 5, 2018
1 parent fee1b0c commit e435f51
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 17 deletions.
52 changes: 36 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Swagger Viewer - v1.7.0
## Swagger Viewer lets you preview swagger files as you type in Visual Studio Code.
# Swagger Viewer - v2.0.0
**Swagger Viewer lets you preview and validate Swagger 2.0 and OpenAPI files as you type in Visual Studio Code.**

It works on swagger files in json and yaml format. Preview happens in real time as you type.
It works on swagger files in json and yaml format. Preview and validation happens in real time as you type.

## Preview

To start
* Open the swagger file and press F1.
Expand All @@ -10,38 +12,53 @@ To start
OR
* Press `Shift + Alt + P`

OR
* Right click file in explorer panel and click `Preview Swagger`

THEN

* Preview It in the editor Itself like this
* Preview it in vscode Itself like this

![Swagger Preview](https://cdn.rawgit.com/arjun-g/vs-swagger-viewer/555c254d/docs/swagger-preview.gif)
![Swagger Preview](https://cdn.rawgit.com/arjun-g/vs-swagger-viewer/2.0.0/docs/swagger-preview.gif)

## Opening In External browser
![Swagger Context Menu](https://cdn.rawgit.com/arjun-g/vs-swagger-viewer/2.0.0/docs/swagger-context-menu.png)

### Opening In External browser

If you want to preview the changes in external browser change the settings `swaggerViewer.previewInBrowser` to `true`

![Swagger Settings](https://cdn.rawgit.com/arjun-g/vs-swagger-viewer/555c254d/docs/swagger-settings.png)
![Swagger Settings](https://cdn.rawgit.com/arjun-g/vs-swagger-viewer/2.0.0/docs/swagger-settings.png)

THEN

* Run the Command `Preview Swagger`.

OR
* Press `Shift + Alt + P`

THEN
**Preview will be automatically opened in default browser.**

* Either:
1. Copy the URL shown in the message box. (Eg. [https://localhost:9000/](https://localhost:9000/))
* Open in any latest browser and see your changes reflecting in real time as you type in the editor.
2. Click on `Open` to open the preview in your default browser.

## Change Default Port
### Change Default Port

Default port of the preview url can be changed by changing the `swaggerViewer.defaultPort` value in `User/Workspace Settings`

## Validation (Partial)

Swagger Viewer validates your documents against Swagger 2.0 and OpenAPI specifications. If there are any issues it will be shown as a warning in the problems panel.

![Swagger Validation](https://cdn.rawgit.com/arjun-g/vs-swagger-viewer/2.0.0/docs/swagger-validation.png)

## Releases

**v2.0.0 Changes**
* Code base changed to TypeScript
* Partial validation support added
* OpenAPI Support added (Not fully tested)
* Only one server runs for the preview page
* Multiple files can be previewed at a time inside vscode
* Context menu added to the explorer to start the preview directly without opening the file
* Using files from swagger-ui-dist npm package - By [@Raptor399](https://github.com/Raptor399) [https://github.com/arjun-g/vs-swagger-viewer/pull/36](https://github.com/arjun-g/vs-swagger-viewer/pull/36)
* Multiple minor bug fixes

v1.7.0 Changes
* Fixed issue in json file parsing. - By [@Zlass](https://github.com/Zlass) [https://github.com/arjun-g/vs-swagger-viewer/pull/27](https://github.com/arjun-g/vs-swagger-viewer/pull/27)

Expand Down Expand Up @@ -81,4 +98,7 @@ Swagger Viewer utilizes the following open source projects
* [Patrick Mentz (@pmentz)](https://github.com/pmentz)
* [Vladimir Vainer (@ferreus)](https://github.com/ferreus)
* [Jonatan Ienco (@jienco)](https://github.com/jienco)
* [@tmsns](https://github.com/tmsns)
* [@tmsns](https://github.com/tmsns)
* [@DW8Reaper](https://github.com/DW8Reaper)
* [@Zlass](https://github.com/Zlass)
* [@Raptor399](https://github.com/Raptor399)
Binary file added docs/swagger-context-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/swagger-validation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/language/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ connection.onInitialize((params: InitializeParams) => {
capabilities: {
textDocumentSync: documents.syncKind,
completionProvider: {
resolveProvider: true
resolveProvider: true,
triggerCharacters: ['"', ':']
}
}
};
Expand Down
Binary file removed static/images/swagger_preview.gif
Binary file not shown.

0 comments on commit e435f51

Please sign in to comment.