Skip to content

Commit 026ec3a

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 026ec3a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

.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"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"build:openapi": "npx @redocly/cli bundle openapi/openapi.yaml -o openapi.yaml && cp openapi.yaml mintlify/openapi.yaml",
77
"prelint:openapi": "npm run build:openapi",
8-
"lint:openapi": "npx @redocly/cli bundle openapi/openapi.yaml -o openapi.yaml && npx @redocly/cli lint openapi.yaml && cp openapi.yaml mintlify/openapi.yaml",
8+
"lint:openapi": "npx @redocly/cli bundle openapi/openapi.yaml -o openapi.yaml && npx @redocly/cli lint openapi.yaml && npx spectral lint openapi.yaml && cp openapi.yaml mintlify/openapi.yaml",
99
"lint": "npm run lint:openapi",
1010
"broken-links": "cd mintlify && mint broken-links",
1111
"validate": "npm run lint",

0 commit comments

Comments
 (0)