# README
OpenAPI 3 Lint
This is a Go-based OpenAPI 3 spec linter.
Spectrum is designed to support a multi-file, multi-user, async editing process where linting reports need to be resilinent to mutiple changes to the specs occurring between the time the validation is run and resolved.
Why Spectrum Linter?
There are a few linters available.
The reasons this exists are:
- written in Go so its easy to use/modify for Go devs
- policy violations are grouped by rule, vs. line number for easier mitigation
- policy violations are identified by JSON Schema pointere vs. line number for easier identification when using merged files
Standard Rules
The following rules are built into Spectrum.
datatype-int-format-standard-exist
: ensures data types ofinteger
have a standard format (int32
orint64
)operation-operationid-style-camelcase
: ensures operationIds use camelCaseoperation-operationid-style-kebabcase
: ensures operationIds use kebab-caseoperation-operationid-style-pascalcase
: ensures operationIds use PascalCaseoperation-operationid-style-snakecase
: ensures operationIds use snake_caseoperation-summary-exist
ensures a summary exists.operation-summary-style-first-uppercase
: ensures summary starts with capitalized first characterpath-param-style-camelcase
: path parms are camel casepath-param-style-kebabcase
: path parms are kebab casepath-param-style-pascalcase
: path parms are Pascal casepath-param-style-snakecase
: path parms are snake caseschema-has-reference
: ensures schemas have referencesschema-object-properties-exist
: schema of typeobject
haveproperties
oradditionalProperties
definedschema-property-enum-style-camelcase
: schema property enums are camel caseschema-property-enum-style-kebabcase
: schema property enums are kebab caseschema-property-enum-style-pascalcase
: schema property enums are Pascal caseschema-property-enum-style-snakecase
: schema property enums are snake caseschema-reference-has-schema
: ensures schma JSON pointers reference existing schemastag-style-first-uppercase
: Tag names have capitalized first character
Other Linters
There are other linters available. To date, Spectrum Linter hasn't beeen inspired by any of them, though there is a desire and effort to align on rule names and potentially rule definitions to achieve similar behavior.
- Mermade OAS-Kit - https://github.com/mermade/oas-kit
- Spectral - https://github.com/stoplightio/spectral
- Inspired by Speccy
- Speccy - https://github.com/wework/speccy
- Inspired by OAS-Kit
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ruleschemaobjectpropsexist ensures that schema objects have properties.
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
No description provided by the author
No description provided by the author
NewPolicyWithConfig is useful when not programatically augmenting the `PolicyConfig` struct before creating the `Policy` struct.
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author