Vale & The OpenAPI Specification

Joseph Kato
Vale
Published in
4 min readSep 25, 2019

--

A tutorial on linting your OpenAPI Specification files

OpenAPI Specification files provide machine-readable (JSON or YAML) descriptions of APIs and often contain snippets of text suitable for linting.

The problem is that the target text can be hard to reach from a linting perspective. For instance, consider the following basic example:

As you can see above, the only parts we’re really interested in are the title, description (which can contain Markdown), and summary keys.

In the following sections, we’ll discuss the three main techniques for linting specification files using Vale (an open-source linter for prose). For the examples, we’ll be referencing the petstore.yaml file from Swagger.

Option 1: No Processing

The easiest way to lint an OpenAPI specification file is to simply pass it, as is, to Vale:

--

--

Vale
Vale

Published in Vale

Weekly tips, tricks, and updates about the Vale linter and its ecosystem of software.

Joseph Kato
Joseph Kato

Written by Joseph Kato

An open-source software developer with interests in natural language processing, data science, and collaborative writing. More @ https://github.com/jdkato.

Responses (2)