Skip to content

refactor(openapi): extract document upload/replace request bodies into reusable components#517

Open
pengying wants to merge 1 commit into
mainfrom
05-27-refactor_openapi_extract_document_upload_replace_request_bodies_into_reusable_components
Open

refactor(openapi): extract document upload/replace request bodies into reusable components#517
pengying wants to merge 1 commit into
mainfrom
05-27-refactor_openapi_extract_document_upload_replace_request_bodies_into_reusable_components

Conversation

@pengying
Copy link
Copy Markdown
Contributor

@pengying pengying commented May 28, 2026

Summary

Extracts the inline requestBody definitions on POST /documents and PUT /documents/{documentId} into reusable components under openapi/components/requestBodies/. The bundler now emits a top-level components.requestBodies section with DocumentUploadRequestBody and DocumentReplaceRequestBody, and the path operations reference them with $ref.

No spec semantics change — the bundled output is structurally equivalent: same required: true, same multipart/form-data, same underlying schemas. Only the wire representation in openapi.yaml differs (refs through components.requestBodies instead of inline definitions). This is a likely candidate for downstream tooling that wants to reuse the bodies (e.g. SDK codegen).

Test plan

  • make build succeeds
  • make lint exits 0
  • Confirmed components.requestBodies is populated and the two paths reference it

@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 1:12am

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

refactor(openapi): extract document upload/replace request bodies into reusable components

csharp

refactor(openapi): extract document upload/replace request bodies into reusable components

go

refactor(openapi): extract document upload/replace request bodies into reusable components

kotlin

refactor(openapi): extract document upload/replace request bodies into reusable components

openapi

refactor(openapi): extract document upload/replace request bodies into reusable components

php

refactor(openapi): extract document upload/replace request bodies into reusable components

python

refactor(openapi): extract document upload/replace request bodies into reusable components

ruby

refactor(openapi): extract document upload/replace request bodies into reusable components

typescript

refactor(openapi): extract document upload/replace request bodies into reusable components

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

grid-typescript studio · code · diff

generate ✅build ⏭️ (prev: build ❗) → lint ⏭️ (prev: lint ❗) → test ⏳

New diagnostics (2 note)
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
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 (2 note)
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
grid-ruby 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 ❗test ✅

New diagnostics (2 note)
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
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 ✅

New diagnostics (2 note)
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
grid-csharp 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 ❗

New diagnostics (2 note)
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
grid-go 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 ❗test ❗

go get github.com/stainless-sdks/grid-go@3179adf9a94f0af3b5caa7adf32891a7d40f626e
New diagnostics (2 note)
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
grid-php studio · code · diff

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

New diagnostics (2 note)
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
grid-kotlin 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 ❗

New diagnostics (2 note)
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
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 (2 note)
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.
💡 Method/BodyRootParamUnnamed: Confirm `body` is an appropriate name for this method's request parameters.

⏳ These are partial results; builds are still running.


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 01:23:06 UTC

@pengying pengying force-pushed the 05-27-refactor_openapi_extract_document_upload_replace_request_bodies_into_reusable_components branch from a74c322 to 49ca343 Compare May 28, 2026 01:12
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 28, 2026

Greptile Summary

This PR extracts the inline requestBody definitions for the document upload (POST /documents) and document replace (PUT /documents/{documentId}) endpoints into reusable components/requestBodies components, following standard OpenAPI 3.x DRY practices. Both bundled output files (openapi.yaml and mintlify/openapi.yaml) are correctly regenerated via make build.

  • Two new component files (DocumentUploadRequestBody.yaml, DocumentReplaceRequestBody.yaml) are added under openapi/components/requestBodies/, with correct relative $ref paths pointing to the existing schema files.
  • The path files are updated to reference the new components via $ref, and the bundles reflect the change with proper #/components/requestBodies/… pointers — no semantic behaviour change.

Confidence Score: 5/5

Pure structural refactor with no functional changes — safe to merge.

The change only moves inline request body definitions into named components and regenerates the bundles. All relative $ref paths resolve to existing files, the bundled output is consistent with the source, and both bundle targets (openapi.yaml and mintlify/openapi.yaml) are kept in sync.

No files require special attention.

Important Files Changed

Filename Overview
openapi/components/requestBodies/DocumentUploadRequestBody.yaml New reusable requestBody component for document upload; $ref path resolves correctly to the existing DocumentUploadRequest schema.
openapi/components/requestBodies/DocumentReplaceRequestBody.yaml New reusable requestBody component for document replace; $ref path resolves correctly to the existing DocumentReplaceRequest schema.
openapi/paths/documents/documents.yaml POST /documents requestBody replaced with $ref to new DocumentUploadRequestBody component; relative path resolves correctly.
openapi/paths/documents/documents_{documentId}.yaml PUT /documents/{documentId} requestBody replaced with $ref to new DocumentReplaceRequestBody component; relative path resolves correctly.
openapi.yaml Regenerated bundle: inline requestBody definitions replaced with component $refs, and new requestBodies section added to components — consistent with source changes.
mintlify/openapi.yaml Mintlify copy of the regenerated bundle; identical changes to openapi.yaml, correctly kept in sync.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["POST /documents\n(documents.yaml)"] -->|"$ref: ../../components/requestBodies/\nDocumentUploadRequestBody.yaml"| B["DocumentUploadRequestBody.yaml"]
    C["PUT /documents/{documentId}\n(documents_{documentId}.yaml)"] -->|"$ref: ../../components/requestBodies/\nDocumentReplaceRequestBody.yaml"| D["DocumentReplaceRequestBody.yaml"]
    B -->|"$ref: ../schemas/documents/\nDocumentUploadRequest.yaml"| E["DocumentUploadRequest.yaml"]
    D -->|"$ref: ../schemas/documents/\nDocumentReplaceRequest.yaml"| F["DocumentReplaceRequest.yaml"]
    G["make build"] --> H["openapi.yaml\nmintlify/openapi.yaml\n(bundles)"]
    H -->|"#/components/requestBodies/\nDocumentUploadRequestBody"| A
    H -->|"#/components/requestBodies/\nDocumentReplaceRequestBody"| C
Loading

Reviews (1): Last reviewed commit: "refactor(openapi): extract document uplo..." | Re-trigger Greptile

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.

2 participants