chore: add Spectral lint to lint:openapi script#332
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR wires Spectral into the Confidence Score: 5/5Safe to merge — all remaining findings are P2 documentation nits with no runtime impact. The core change (Spectral integration) is straightforward and correct. Schema extractions faithfully preserve the original inline definitions. The only issue is a copy-paste error in a description string inside InternalAccountListResponse.yaml, which is a P2 style concern with no functional effect. openapi/components/schemas/customers/InternalAccountListResponse.yaml — minor description copy-paste error on the totalCount field.
|
| Filename | Overview |
|---|---|
| package.json | Adds npx spectral lint openapi.yaml --fail-severity=error between the Redocly lint step and the final copy; correct and consistent with the Makefile target. |
| .spectral.yaml | Adds resolved: false to no-inline-request-schema and no-inline-response-schema rules so Spectral checks raw YAML without first resolving $refs, eliminating false positives. |
| .github/workflows/lint.yml | Correctly adds .spectral.yaml to the path triggers so changes to Spectral rules also fire the lint CI job. |
| openapi/components/schemas/customers/InternalAccountListResponse.yaml | New list-response schema extracted from inline path definition; totalCount description incorrectly says "customers" instead of "internal accounts". |
| openapi/components/schemas/receiver/ReceiverExternalAccountLookupResponse.yaml | Faithfully extracts the allOf + accountId extension that was previously inline in the path file. |
| openapi/components/schemas/customers/PlatformInternalAccountListResponse.yaml | Slim list-response (data-only, no pagination fields) matching the original platform endpoint's inline schema. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[npm run lint:openapi] --> B[prelint:openapi\nbuild:openapi]
B --> C[Redocly bundle\nopenapi/ → openapi.yaml]
C --> D[cp openapi.yaml\nmintlify/openapi.yaml]
A --> E[lint:openapi script]
E --> F[Redocly bundle again\nopenapi/ → openapi.yaml]
F --> G[Redocly lint\nopenapi.yaml]
G --> H[NEW: Spectral lint\nopenapi.yaml --fail-severity=error]
H --> I[cp openapi.yaml\nmintlify/openapi.yaml]
H -->|fail| J[❌ Exit non-zero]
I --> K[✅ Done]
Prompt To Fix All With AI
This is a comment left during a code review.
Path: openapi/components/schemas/customers/InternalAccountListResponse.yaml
Line: 21-23
Comment:
**Copy-paste error in `totalCount` description**
The description reads "Total number of *customers* matching the criteria" but this schema represents internal accounts, not customers. This was copied verbatim from `CustomerListResponse.yaml`.
```suggestion
description: >-
Total number of internal accounts matching the criteria (excluding
pagination)
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (4): Last reviewed commit: "chore: add Spectral lint to lint:openapi..." | Re-trigger Greptile
✱ Stainless preview buildsThis PR will update the kotlin openapi python typescript
|
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>
Summary
npx spectral lint openapi.yamlto thelint:openapiscript in package.json.spectral.yamlrules (naming conventions, discriminators, inline schemas, pagination, etc.)Test plan
npm run lint:openapiruns Spectral successfully🤖 Generated with Claude Code