Skip to content

Commit 0dcd690

Browse files
pengyingclaude
andcommitted
chore: add Spectral lint to lint:openapi script
Runs Spectral's OpenAPI linter (custom rules in .spectral.yaml) as part of the lint:openapi pipeline, after Redocly bundle and lint. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 80ac181 commit 0dcd690

35 files changed

Lines changed: 830 additions & 750 deletions

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ on:
77
- 'openapi.yaml'
88
- 'openapi/**'
99
- '.markdownlint.json'
10+
- '.spectral.yaml'
1011
- 'mintlify/**'
1112
pull_request:
1213
branches: [ main ]
1314
paths:
1415
- 'openapi.yaml'
1516
- 'openapi/**'
1617
- '.markdownlint.json'
18+
- '.spectral.yaml'
1719
- 'mintlify/**'
1820
# Allow manual triggering
1921
workflow_dispatch:

.spectral.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,11 @@ rules:
7676
# ============================================================
7777

7878
# Request bodies must use $ref, not inline schemas.
79-
# Note: Spectral resolves $refs in the bundled spec, so some component-level
80-
# false positives appear — the real violations are on paths.* entries.
8179
no-inline-request-schema:
8280
description: Request body schemas must use $ref, not inline definitions
8381
message: "Use $ref for request body schema instead of inline definition. See openapi/README.md#avoid-inline-schemas-in-request-and-response-definitions"
8482
severity: error
83+
resolved: false
8584
given: "$.paths[*][get,post,put,patch,delete].requestBody.content[application/json].schema"
8685
then:
8786
field: "$ref"
@@ -92,6 +91,7 @@ rules:
9291
description: Response body schemas must use $ref, not inline definitions
9392
message: "Use $ref for response schema instead of inline definition. See openapi/README.md#avoid-inline-schemas-in-request-and-response-definitions"
9493
severity: error
94+
resolved: false
9595
given: "$.paths[*][get,post,put,patch,delete].responses[*].content[application/json].schema"
9696
then:
9797
field: "$ref"

0 commit comments

Comments
 (0)