diff --git a/1.png b/1.png index b6e1889..8d37c56 100644 Binary files a/1.png and b/1.png differ diff --git a/README.md b/README.md index ba657c6..f65242f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# OpenAPI Contract Diff [![Version](https://img.shields.io/vscode-marketplace/v/knom.vsts-swagger-diff.svg?label=VS%20Marketplace&logo=visual-studio-code&logoColor=white)](https://marketplace.visualstudio.com/items?itemName=knom.vsts-swagger-diff) [![Visual Studio Marketplace Downloads](https://img.shields.io/vscode-marketplace/d/knom.vsts-swagger-diff.svg?logo=visual-studio-code&logoColor=white)](https://marketplace.visualstudio.com/items?itemName=knom.vsts-swagger-diff) [![GitHub License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/knom/vsts-swagger-tasks/blob/master/LICENSE) ![Build Status](https://knom-msft.visualstudio.com/_apis/public/build/definitions/9d8fcb7c-6c11-4014-9dc2-7966c94af2b2/7/badge) +# OpenAPI Contract Diff +[![Version](https://img.shields.io/vscode-marketplace/v/knom.vsts-swagger-diff.svg?label=VS%20Marketplace&logo=visual-studio-code&logoColor=white)](https://marketplace.visualstudio.com/items?itemName=knom.vsts-swagger-diff) [![Visual Studio Marketplace Downloads](https://img.shields.io/vscode-marketplace/d/knom.vsts-swagger-diff.svg?logo=visual-studio-code&logoColor=white)](https://marketplace.visualstudio.com/items?itemName=knom.vsts-swagger-diff) [![GitHub License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/knom/vsts-swagger-tasks/blob/master/LICENSE) ![Build Status](https://knom-msft.visualstudio.com/_apis/public/build/definitions/9d8fcb7c-6c11-4014-9dc2-7966c94af2b2/7/badge) A build/release task for comparing OpenAPI Contracts. @@ -13,7 +14,26 @@ You can use the task for making sure a certain Swagger contract still is in comp **If an ERROR occurs, the task will per default STOP the build or release pipeline. Hence it can act as a quality gate for e.g. a release** > Note: The task is using the following libraries... -* https://www.npmjs.com/package/swagger-diff for 2.0 -* https://www.npmjs.com/package/openapi-diff for 3.0 +> * https://www.npmjs.com/package/swagger-diff for 2.0 +> * https://www.npmjs.com/package/openapi-diff for 3.0 -``` + +## Usage +Configure the schema version of the contract (both have to have the same version) +* OpenAPI (3.0) +* Swagger (2.0) + +Add left- and right-side contract, which can be +* a file on the build agent +* a publicly accessible URL + +![Usage](src/docs/task.png) + +## Output +### Sample output of diff-comparison of two **OpenAPI v3 contracts** +![Result1](src/docs/result1.png) + +> Note: Right now OpenAPI DIFF is way less detailed than Swagger one is. This is back to the output of the underlying libraries. + +### Sample output of diff-comparison of two **Swagger v2 contracts** +![Result2](src/docs/result2.png) \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 4ba1942..7a80d80 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -121,9 +121,7 @@ gulp.task( .src( [ "./extension-icon*.png", - "LICENSE.md", "PRIVACY.md", - "README.md", "package.json", "docs/**/*", "!src/**", diff --git a/icon.svg b/icon.svg index 2e0686e..32aac73 100644 --- a/icon.svg +++ b/icon.svg @@ -1,6 +1,4 @@ - - @@ -42,17 +40,19 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="0.24748737" - inkscape:cx="1341.386" - inkscape:cy="1315.6829" + inkscape:zoom="0.69999999" + inkscape:cx="721.71956" + inkscape:cy="490.39022" inkscape:document-units="mm" - inkscape:current-layer="layer3" + inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="1920" - inkscape:window-height="1017" + inkscape:window-height="976" inkscape:window-x="1912" inkscape:window-y="-8" - inkscape:window-maximized="1" /> + inkscape:window-maximized="1" + inkscape:document-rotation="0" + showguides="false" /> @@ -66,9 +66,20 @@ + + + id="layer1" + style="display:inline"> - - - + id="g1770"> - - - - - - - - - - - + style="display:inline;fill:#ffffff;stroke-width:1.01487;paint-order:markers stroke fill" + id="path1718" + cx="75.368454" + cy="75.973213" + r="77.40155" + transform="translate(-2.2678572,16.630953)" /> - + + + + + + + + + + + + + + + + + + + + + + + + è - è + ç + id="text1021" + transform="scale(0.97703432,1.0235055)">ç + diff --git a/src/README.md b/src/README.md deleted file mode 100644 index 93f0184..0000000 --- a/src/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# OpenAPI Contract Diff - -A build/release task for comparing OpenAPI Contracts. - -Pass in URLs or Paths of OpenAPI (3.0) or Swagger (2.0) Contracts. - -The task will compare the two contracts "left-side" and "right-side". - -It will output any **differences** as **info, warning, errors** depending on the configuration. - -You can use the task for making sure a certain Swagger contract still is in compliance with a specification. - -**If an ERROR occurs, the task will per default STOP the build or release pipeline. Hence it can act as a quality gate for e.g. a release** - -> Note: The task is using the following libraries... -* https://www.npmjs.com/package/swagger-diff for 2.0 -* https://www.npmjs.com/package/openapi-diff for 3.0 - -``` \ No newline at end of file diff --git a/LICENSE.md b/src/docs/LICENSE.md similarity index 96% rename from LICENSE.md rename to src/docs/LICENSE.md index a5b92eb..5c1646a 100644 --- a/LICENSE.md +++ b/src/docs/LICENSE.md @@ -1,4 +1,4 @@ -# VSTS Swagger Diff Build/RM Tasks +# OpenAPI Contract Diff Copyright (c) 2021 knom diff --git a/src/docs/OVERVIEW.md b/src/docs/OVERVIEW.md new file mode 100644 index 0000000..9a3db20 --- /dev/null +++ b/src/docs/OVERVIEW.md @@ -0,0 +1,39 @@ +# OpenAPI Contract Diff +[![Version](https://img.shields.io/vscode-marketplace/v/knom.vsts-swagger-diff.svg?label=VS%20Marketplace&logo=visual-studio-code&logoColor=white)](https://marketplace.visualstudio.com/items?itemName=knom.vsts-swagger-diff) [![Visual Studio Marketplace Downloads](https://img.shields.io/vscode-marketplace/d/knom.vsts-swagger-diff.svg?logo=visual-studio-code&logoColor=white)](https://marketplace.visualstudio.com/items?itemName=knom.vsts-swagger-diff) [![GitHub License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/knom/vsts-swagger-tasks/blob/master/LICENSE) ![Build Status](https://knom-msft.visualstudio.com/_apis/public/build/definitions/9d8fcb7c-6c11-4014-9dc2-7966c94af2b2/7/badge) + +A build/release task for comparing OpenAPI Contracts. + +Pass in URLs or Paths of OpenAPI (3.0) or Swagger (2.0) Contracts. + +The task will compare the two contracts "left-side" and "right-side". + +It will output any **differences** as **info, warning, errors** depending on the configuration. + +You can use the task for making sure a certain Swagger contract still is in compliance with a specification. + +**If an ERROR occurs, the task will per default STOP the build or release pipeline. Hence it can act as a quality gate for e.g. a release** + +> Note: The task is using the following libraries... +> * https://www.npmjs.com/package/swagger-diff for 2.0 +> * https://www.npmjs.com/package/openapi-diff for 3.0 + + +## Usage +Configure the schema version of the contract (both have to have the same version) +* OpenAPI (3.0) +* Swagger (2.0) + +Add left- and right-side contract, which can be +* a file on the build agent +* a publicly accessible URL + +![Usage](docs/task.png) + +## Output +### Sample output of diff-comparison of two **OpenAPI v3 contracts** +![Result1](docs/result1.png) + +> Note: Right now OpenAPI DIFF is way less detailed than Swagger one is. This is back to the output of the underlying libraries. + +### Sample output of diff-comparison of two **Swagger v2 contracts** +![Result2](docs/result2.png) \ No newline at end of file diff --git a/src/docs/result1.png b/src/docs/result1.png index 1544a3a..14d5a55 100644 Binary files a/src/docs/result1.png and b/src/docs/result1.png differ diff --git a/src/docs/result2.png b/src/docs/result2.png index 6825fac..20dc5b1 100644 Binary files a/src/docs/result2.png and b/src/docs/result2.png differ diff --git a/src/docs/task.png b/src/docs/task.png index dcfee93..12186d2 100644 Binary files a/src/docs/task.png and b/src/docs/task.png differ diff --git a/src/images/logo.png b/src/images/logo.png index 68997ce..91d73c3 100644 Binary files a/src/images/logo.png and b/src/images/logo.png differ diff --git a/src/images/logo_large.png b/src/images/logo_large.png index b6e1889..8d37c56 100644 Binary files a/src/images/logo_large.png and b/src/images/logo_large.png differ diff --git a/src/vss-extension.json b/src/vss-extension.json index 0e3f5da..324fcb1 100644 --- a/src/vss-extension.json +++ b/src/vss-extension.json @@ -52,7 +52,8 @@ "color": "#777", "theme": "dark" }, - "screenshots": [{ + "screenshots": [ + { "path": "docs/task.png" }, { @@ -64,28 +65,40 @@ ], "content": { "details": { - "path": "README.md" + "path": "docs/OVERVIEW.md" + }, + "license": { + "path": "docs/LICENSE.md" } }, - "files": [{ + "files": [ + { "path": "images", "addressable": true }, + { + "path": "docs", + "addressable": true + }, { "path": "swagger-diff" } ], - "targets": [{ - "id": "Microsoft.VisualStudio.Services" - }], - "contributions": [{ - "id": "swagger-diff", - "type": "ms.vss-distributed-task.task", - "targets": [ - "ms.vss-distributed-task.tasks" - ], - "properties": { - "name": "swagger-diff" + "targets": [ + { + "id": "Microsoft.VisualStudio.Services" + } + ], + "contributions": [ + { + "id": "swagger-diff", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "swagger-diff" + } } - }] + ] } \ No newline at end of file