fix(spectral): broaden no-inline-schema rules to all content types#519
fix(spectral): broaden no-inline-schema rules to all content types#519pengying wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
✱ Stainless preview builds for gridThis PR will update the cli csharp go kotlin openapi php python ruby typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-openapi studio · code · diff
|
| 💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentAccountRestrictions` |
| 💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentAccountRule` |
| 💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentApprovalThresholds` |
⚠️ grid-typescript studio · code · diff
Your SDK build had a failure in the build CI job, which is a regression from the base state.
generate ✅→build ❗(prev:build ⏭️) →lint ❗(prev:lint ⏭️) →test ❗(prev:test ✅)New diagnostics (3 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentAccountRestrictions` 💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentAccountRule` 💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentApprovalThresholds`
✅ grid-python studio · code · diff
Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅→build ✅(prev:build ⏭️) →lint ✅(prev:lint ⏭️) →test ✅pip install https://pkg.stainless.com/s/grid-python/9132b0e96ee15355c3275ce747346fa11439af9c/grid-0.0.1-py3-none-any.whlNew diagnostics (3 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentAccountRestrictions` 💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentAccountRule` 💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentApprovalThresholds`
⚠️ grid-csharp studio · code · diff
Your SDK build had at least one "error" diagnostic, which is a regression from the base state.
generate ❗(prev:generate ⚠️) →build ❗(prev:build ⏭️) →lint ❗(prev:lint ⏭️) →test ❗New diagnostics (1 error, 5 note)
❗ InvalidInternalState: Internal error, please try again. 💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentAccountRestrictions` 💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentAccountRule` 💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentApprovalThresholds` 💡 Schema/EnumHasOneMember: Confirm intentional use of `enum` with single member. 💡 Name/Renamed: 396 names were renamed due to language constraints, so fallback names will be used instead.
⚠️ grid-go studio · code · diff
Your SDK build had at least one "error" diagnostic, which is a regression from the base state.
generate ❗(prev:generate ✅) →build ✅(prev:build ⏭️) →lint ❗→test ❗go get github.com/stainless-sdks/grid-go@d3e4b25756a48fa56bf4c04fa137a803127cdd6dNew diagnostics (3 error, 1 note)
❗ Model/GeneratedNameClash: Name clash may cause compile errors. ❗ Model/GeneratedNameClash: Name clash may cause compile errors. ❗ Model/GeneratedNameClash: Name clash may cause compile errors. 💡 Schema/EnumHasOneMember: Confirm intentional use of `enum` with single member.
⚠️ grid-php studio · code · diff
Your SDK build had at least one "error" diagnostic, which is a regression from the base state.
generate ❗(prev:generate ✅) →lint ❗(prev:lint ✅) →test ✅New diagnostics (2 error, 4 warning, 4 note)
❗ InvalidInternalState: Internal error, please try again. ❗ InvalidInternalState: Internal error, please try again. ⚠️ Name/Collision: Possible undesirable name generated for language⚠️ Name/Collision: Possible undesirable name generated for language⚠️ Name/Collision: Possible undesirable name generated for language⚠️ InvalidInternalStateWarning: Something unexpected happened during codegen. Our team has been notified. Your SDK was still generated correctly, and no action is needed on your end. If you need help please reach out to support@stainless.com. --- Cannot have two defs with the same ID.Provide a slug for at least one def to disambiguate them.
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentAccountRestrictions` 💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentAccountRule` 💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentApprovalThresholds` 💡 Schema/EnumHasOneMember: Confirm intentional use of `enum` with single member.
⚠️ grid-kotlin studio · code · diff
Your SDK build had a failure in the build CI job, which is a regression from the base state.
generate ✅→build ❗(prev:build ⏭️) →lint ✅(prev:lint ⏭️) →test ❗New diagnostics (1 note)
💡 Schema/EnumHasOneMember: Confirm intentional use of `enum` with single member.
✅ grid-cli studio · code · diff
Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ⚠️→build ❗→lint ❗→test ❗New diagnostics (3 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentAccountRestrictions` 💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentAccountRule` 💡 Model/Recommended: We recommend you use a model for `#/components/schemas/AgentApprovalThresholds`
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-05-28 04:39:58 UTC
Greptile SummaryThis PR broadens the Spectral
Confidence Score: 5/5Safe to merge — the lint rule broadening and schema extraction are tightly scoped, mechanically correct, and the generated bundles match the source changes. The Spectral path expression change is a one-character widening that correctly extends the existing enforcement to all content types. The BulkCustomerImportRequest schema is a verbatim extraction of the previously inline definition with no semantic change. Both generated bundles reflect exactly what make build would produce from the edited source. No files require special attention.
|
| Filename | Overview |
|---|---|
| .spectral.yaml | Broadened no-inline-request-schema and no-inline-response-schema rules from application/json to all content types — minimal, correct change. |
| openapi/paths/customers/customers_bulk_csv.yaml | Replaces inline multipart/form-data schema with a $ref to the new BulkCustomerImportRequest component schema. |
| openapi/components/schemas/customers/BulkCustomerImportRequest.yaml | New schema file extracting the BulkCustomerImportRequest definition; content is identical to what was previously inline. |
| openapi.yaml | Regenerated bundle reflecting the schema extraction in the openapi/ source files. |
| mintlify/openapi.yaml | Regenerated Mintlify bundle, identical structural change to openapi.yaml. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Spectral Lint Run] --> B{no-inline-request-schema\ngiven: content.*.schema}
B --> C[multipart/form-data]
B --> D[application/json]
B --> E[application/octet-stream\netc.]
C --> F{schema has $ref?}
D --> F
E --> F
F -- Yes --> G[✅ Pass]
F -- No --> H[❌ Error: use $ref]
I[POST /customers/bulk-csv] --> J[requestBody\ncontent: multipart/form-data]
J --> K[$ref: BulkCustomerImportRequest]
K --> L[components/schemas/\nBulkCustomerImportRequest.yaml]
Reviews (1): Last reviewed commit: "fix(spectral): broaden no-inline-schema ..." | Re-trigger Greptile
f84586d to
a00d279
Compare
3374d43 to
98fbd81
Compare
a00d279 to
d329472
Compare
98fbd81 to
1d7ad1e
Compare
1d7ad1e to
990a651
Compare

Summary
Broadens the
no-inline-request-schemaandno-inline-response-schemaSpectral rules from hardcodedapplication/jsoncontent to all content types. Also extracts the previously-missed inline schema onPOST /customers/bulk/csv(which usesmultipart/form-data) into a newBulkCustomerImportRequestcomponent.Why
When extracting the document
requestBodys in #517, I noticed the existing rule wouldn't have caught inline schemas undermultipart/form-data— the JSONPath was scoped tocontent[application/json].schema. That left a hole in the lint that masked the inline file-upload schema on the bulk CSV endpoint.Before:
After:
Same change applied to the response rule.
Changes
.spectral.yaml: widen JSONPath on bothno-inline-request-schemaandno-inline-response-schemato match all content types.openapi/components/schemas/customers/BulkCustomerImportRequest.yaml: new component for the bulk CSV upload body (file: binary).openapi/paths/customers/customers_bulk_csv.yaml: replace inline schema with$ref.openapi.yaml/mintlify/openapi.yaml.Test plan
make buildsucceedsmake lintexits 0Stack
Stacked on top of #518 / #517.