Skip to content
Merged
Show file tree
Hide file tree
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
35 changes: 35 additions & 0 deletions .github/workflows/openapi-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Lint OpenAPI Specs

on:
push:
branches: [ main, master ]
paths:
- 'specs/**'
- '.github/workflows/openapi-lint.yml'
- '.spectral.yaml'
pull_request:
branches: [ main, master ]
paths:
- 'specs/**'
- '.github/workflows/openapi-lint.yml'
- '.spectral.yaml'

jobs:
lint:
name: Lint OpenAPI files with Spectral
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install Spectral
run: npm install -g @stoplight/spectral-cli

- name: Lint OpenAPI Specs
run: spectral lint "specs/*.openapi.yml" --verbose

7 changes: 7 additions & 0 deletions .spectral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends: spectral:oas

rules:
# Disable validation of examples for non-JSON media types (like jsonl)
# because Spectral tries to parse them as JSON and fails on multi-line/concatenated JSON
oas3-valid-media-example: off

Loading