refactor(openapi): extract document upload/replace request bodies into reusable components#517
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-typescript studio · code · diff
✅ grid-openapi studio · code · diff
✅ grid-ruby studio · code · diff
✅ grid-python studio · code · diff
✅ grid-csharp studio · code · diff
✅ grid-go studio · code · diff
✅ grid-php studio · code · diff
✅ grid-kotlin studio · code · diff
✅ grid-cli studio · code · diff
⏳ 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. |
…o reusable components
a74c322 to
49ca343
Compare
Greptile SummaryThis PR extracts the inline
Confidence Score: 5/5Pure 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.
|
| 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
Reviews (1): Last reviewed commit: "refactor(openapi): extract document uplo..." | Re-trigger Greptile

Summary
Extracts the inline
requestBodydefinitions onPOST /documentsandPUT /documents/{documentId}into reusable components underopenapi/components/requestBodies/. The bundler now emits a top-levelcomponents.requestBodiessection withDocumentUploadRequestBodyandDocumentReplaceRequestBody, and the path operations reference them with$ref.No spec semantics change — the bundled output is structurally equivalent: same
required: true, samemultipart/form-data, same underlying schemas. Only the wire representation inopenapi.yamldiffers (refs throughcomponents.requestBodiesinstead of inline definitions). This is a likely candidate for downstream tooling that wants to reuse the bodies (e.g. SDK codegen).Test plan
make buildsucceedsmake lintexits 0components.requestBodiesis populated and the two paths reference it