Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rules file for Spectral oas linter #102

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .spectral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
extends: spectral:oas
rules:
info-contact: off
info-description: off
oas3-api-servers: off
operation-tags: off

# Turn off oas3-unused-component because many examples are partial
# and thus do not include the use of every component
oas3-unused-component: off

# OAS conventions for AIPs

aip-parameter-names-convention:
description: Parameter names should be camelCase.
severity: warn
# Make an exception for header parameters, which should be kebab-case
given:
- $.paths[*].parameters.[?(@.in!='header')]
- $.paths.*[get,put,post,patch,delete,options,head].parameters[?(@.in!='header')]
then:
field: "name"
function: "casing"
functionOptions:
type: "camel"

aip-property-names-convention:
description: Property names should be camelCase.
severity: warn
given: $..properties.*~
then:
field: "@key"
function: "casing"
functionOptions:
type: "camel"