Skip to content

fix(spectral): broaden no-inline-schema rules to all content types#519

Open
pengying wants to merge 1 commit into
mainfrom
05-27-fix_spectral_broaden_no-inline-schema_rules_to_all_content_types
Open

fix(spectral): broaden no-inline-schema rules to all content types#519
pengying wants to merge 1 commit into
mainfrom
05-27-fix_spectral_broaden_no-inline-schema_rules_to_all_content_types

Conversation

@pengying
Copy link
Copy Markdown
Contributor

@pengying pengying commented May 28, 2026

Summary

Broadens the no-inline-request-schema and no-inline-response-schema Spectral rules from hardcoded application/json content to all content types. Also extracts the previously-missed inline schema on POST /customers/bulk/csv (which uses multipart/form-data) into a new BulkCustomerImportRequest component.

Why

When extracting the document requestBodys in #517, I noticed the existing rule wouldn't have caught inline schemas under multipart/form-data — the JSONPath was scoped to content[application/json].schema. That left a hole in the lint that masked the inline file-upload schema on the bulk CSV endpoint.

Before:

given: "$.paths[*][...].requestBody.content[application/json].schema"

After:

given: "$.paths[*][...].requestBody.content.*.schema"

Same change applied to the response rule.

Changes

  • .spectral.yaml: widen JSONPath on both no-inline-request-schema and no-inline-response-schema to 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.
  • Rebundled openapi.yaml / mintlify/openapi.yaml.

Test plan

  • make build succeeds
  • make lint exits 0

Stack

Stacked on top of #518 / #517.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
grid-flow-builder Ready Ready Preview, Comment May 28, 2026 4:34am

Request Review

Copy link
Copy Markdown
Contributor Author

pengying commented May 28, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

✱ Stainless preview builds for grid

This PR will update the grid SDKs with the following commit messages.

cli

fix(spectral): broaden no-inline-schema rules to all content types

csharp

fix(spectral): broaden no-inline-schema rules to all content types

go

fix(spectral): broaden no-inline-schema rules to all content types

kotlin

fix(spectral): broaden no-inline-schema rules to all content types

openapi

fix(spectral): broaden no-inline-schema rules to all content types

php

fix(spectral): broaden no-inline-schema rules to all content types

python

fix(spectral): broaden no-inline-schema rules to all content types

ruby

fix(spectral): broaden no-inline-schema rules to all content types

typescript

fix(spectral): broaden no-inline-schema rules to all content types

Edit this comment to update them. They will appear in their respective SDK's changelogs.

grid-openapi studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅

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-ruby studio · code · diff

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ⚠️build ✅ (prev: build ⏭️) → lint ❗ (prev: 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`
⚠️ 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.whl
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-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@d3e4b25756a48fa56bf4c04fa137a803127cdd6d
New 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-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 28, 2026

Greptile Summary

This PR broadens the Spectral no-inline-request-schema and no-inline-response-schema lint rules from application/json only to all content types (content.*), and fixes the multipart/form-data request body on the bulk CSV import endpoint that was previously uncaught by the narrower rule.

  • .spectral.yaml: Replaces content[application/json].schema with content.*.schema in both no-inline rules so all content types (e.g., multipart/form-data) are now enforced.
  • openapi/paths/customers/customers_bulk_csv.yaml + new openapi/components/schemas/customers/BulkCustomerImportRequest.yaml: Extracts the previously inline multipart/form-data schema into a proper $ref-backed component schema, bringing the endpoint into compliance with the broadened rule.
  • openapi.yaml / mintlify/openapi.yaml: Regenerated bundles reflecting the source changes above.

Confidence Score: 5/5

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

Important Files Changed

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]
Loading

Reviews (1): Last reviewed commit: "fix(spectral): broaden no-inline-schema ..." | Re-trigger Greptile

@pengying pengying changed the base branch from 05-27-chore_stainless_add_ruby_go_csharp_php_cli_targets_and_sync_resources to graphite-base/519 May 28, 2026 01:51
@pengying pengying force-pushed the graphite-base/519 branch from f84586d to a00d279 Compare May 28, 2026 01:52
@pengying pengying force-pushed the 05-27-fix_spectral_broaden_no-inline-schema_rules_to_all_content_types branch from 3374d43 to 98fbd81 Compare May 28, 2026 01:52
@pengying pengying changed the base branch from graphite-base/519 to 05-27-chore_stainless_add_ruby_go_csharp_php_cli_targets_and_sync_resources May 28, 2026 01:52
@pengying pengying changed the base branch from 05-27-chore_stainless_add_ruby_go_csharp_php_cli_targets_and_sync_resources to graphite-base/519 May 28, 2026 04:32
@pengying pengying force-pushed the graphite-base/519 branch from a00d279 to d329472 Compare May 28, 2026 04:33
@pengying pengying force-pushed the 05-27-fix_spectral_broaden_no-inline-schema_rules_to_all_content_types branch from 98fbd81 to 1d7ad1e Compare May 28, 2026 04:33
@graphite-app graphite-app Bot changed the base branch from graphite-base/519 to main May 28, 2026 04:34
@pengying pengying force-pushed the 05-27-fix_spectral_broaden_no-inline-schema_rules_to_all_content_types branch from 1d7ad1e to 990a651 Compare May 28, 2026 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant