This is a Visual Studio Code Extension that compares the changes made to a Swagger 2.0
spec and shows the Breaking and other changes in a table format.
It will help Developers to know the impact of the changes they applied.
Diff View (works with GitLens also):
side by side and diff view's might take a bit more time, based on the file size
- Open any Swagger 2.0 spec file with working changes
(or) Open 2 Swagger 2.0 spec files in a split view (i.e. side-by-side)
(or) Open diff for a Swagger 2.0 spec file (also supports viewing diff from older commits using GitLens) - Open Command Palette (
ctrl
+shift
+p
) and run the commandSwagger Diff
- Or use the keyboard shortcut
shift
+alt
+d
- The results will be shown in a new
WebViewPanel
- Click anywhere in the result panel
- click
ctrl
+a
(orcmd
+a
for mac) to select all contents - click
ctrl
+c
(orcmd
+c
for mac) to copy the selected contents
There are 2 types of changes:
- breaking change
- smooth change
Examples:
- Delete path
- Rename path operationId
- Delete/Rename parametters
- Add a constraint on a parametter (like isRequired)
- Modify a response item
In the extension the breaking changes are considered as
Error level
Examples:
- Add a path
- Add a param
- Add response item
- Add/Update descriptions
In the extension the smooth changes are considered as
Warning level
In some Scenarios the utility may be unable to categorize the change, they will be coming under
UnCategorized level
- It works for Swagger 2.0 specs only
- The file must be a part of a git repository
- Added a default Keyboard Shortcut
- Added new functionality to compare 2 swagger files opened side by side (also works for git diff and GitLens)
- Initial release
Swagger Viewer utilizes the following open source projects