openapi-linter

command module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2018 License: MIT Imports: 2 Imported by: 0

README

OpenAPI Linter

Documentation

A simple linter for openapi (swagger) specs.

Getting Started

Installation

Download - Github Releases Page

OpenAPI Linter is a single executable binary. You can download the latest release for your platform from the Github Releases page linked above.

Or you can build it from source:

git clone https://github.com/place1/openapi-linter
cd openapi-linter
go build
./openapi-linter --help

Quickstart

Once you've got the binary (make sure it's on your $PATH) you can use it like this:

openapi-linter ./path/to/openapi.yaml

By default openapi-linter will look for a config file in the current directory called openapi-linter.yaml. Here's an example config file with some comments:

# openapi-linter.yaml
rules:
  noEmptyOperationIDs: true  # make sure all operations have an ID
  noEmptyDescriptions:
    operations: true         # operations must have descriptions
    parameters: true         # parameters must have descriptions
    properties: false        # properties may omit the description field
  naming:                    # naming conventions for different components of the spec
    paths: KebabCase
    tags: PascalCase
    operation: CamelCase
    parameters: SnakeCase

You can also use the --config <file> flag to specify a different file.

See Rules Docs

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL