Atom Packages Directory

a package directory for a text editor of the 21st Century

Linter Swagger Improved

Install with:
    apm install linter-swagger-improved
  

Update: March 20th 2017
The improved error handler from within this project has now been merged into the main linter-swagger project. This project will be kept here for reference, but I recommend everyone switch to using the linter-swagger project where this functionality will be maintained from now on.

linter-swagger-improved

apm apm

An improved version of the linter-swagger plugin with better identification of errors within your swagger files.

This plugin for Linter will lint Swagger 2.0 specifications, both JSON and YAML using swagger-parser node package.

Linting Examples

Debugging Swagger spec errors has always been a frustrating experience, with the error messages given seemingly random and arbitrary. Here are a few examples of how this plugin improves things.

Invalid Types

yaml swagger: "2.0" info: title: "Sample 1" version: "1.0.0" paths: /todos: get: description: "Returns all todo items" responses: 200: description: "A list of todo items" schema: type: array items: type: object properties: id: type: strin format: uuid name: type: string | Now | Sample 1 Errors After | —|— | Before | Sample 1 Errors Before |

Invalid Properties

yaml swagger: "2.0" info: title: "Sample 2" version: "1.0.0" paths: /todos: get: description: "Returns all todo items" responses: 200: description: "A list of todo items" schema: type: array items: type: object properties: id: type: string forma: uuid name: type: string | Now | Sample 2 Errors After | —|— | Before | Sample 2 Errors Before |

Installation

Install linter-swagger-improved either in Atom’s Preferences/Install Packages, or with apm on the command-line:

sh apm install linter-swagger-improved

This package will automatically install linter if that is missing.

License

MIT. More info in the LICENSE file

Keywords: swagger, linter, atom Suggest keywords
Fork me on GitHub