Skip to content

Comments

feat: extracting inline schemas to their own schema objects for better code gen#219

Open
pengying wants to merge 1 commit into02-20-feat_removing_customerid_from_platformexternalaccount_requestfrom
02-20-feat_extracting_inline_schemas_to_their_own_schema_objects_for_better_code_gen
Open

feat: extracting inline schemas to their own schema objects for better code gen#219
pengying wants to merge 1 commit into02-20-feat_removing_customerid_from_platformexternalaccount_requestfrom
02-20-feat_extracting_inline_schemas_to_their_own_schema_objects_for_better_code_gen

Conversation

@pengying
Copy link
Contributor

@pengying pengying commented Feb 20, 2026

TL;DR

Refactored OpenAPI specification by extracting inline schema definitions into reusable schema components.

What changed?

Extracted inline schema definitions from API endpoints into separate reusable schema components in the components/schemas section. This affects multiple endpoints including:

  • Platform configuration updates (PlatformConfigUpdateRequest)
  • Customer KYC links (KycLinkResponse)
  • Transfer operations (TransferInRequest, TransferOutRequest)
  • Payment approvals/rejections (ApprovePaymentRequest, RejectPaymentRequest)
  • Bulk customer imports (BulkCustomerImportJobAccepted)
  • UMA invitations (UmaInvitationCreateRequest, UmaInvitationClaimRequest)
  • Sandbox operations (SandboxSendRequest, SandboxUmaReceiveRequest, SandboxFundRequest)
  • API token creation (ApiTokenCreateRequest)

Each inline schema definition was replaced with a $ref reference to the corresponding component schema.

How to test?

  1. Validate the OpenAPI specification using an OpenAPI validator
  2. Generate API documentation to ensure all schemas render correctly
  3. Test API client generation to verify schema references resolve properly
  4. Verify that all endpoint request/response schemas maintain the same structure and validation rules

Why make this change?

This refactoring improves the OpenAPI specification by:

  • Reducing duplication of schema definitions
  • Making schemas reusable across multiple endpoints
  • Improving maintainability by centralizing schema definitions
  • Following OpenAPI best practices for schema organization
  • Making the specification more modular and easier to manage

Copy link
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link

github-actions bot commented Feb 20, 2026

✱ Stainless preview builds

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

kotlin

chore(internal): regenerate SDK with no functional changes

openapi

chore(internal): extract inline schemas to named components across multiple resources

python

chore(internal): regenerate SDK with no functional changes

typescript

chore(internal): regenerate SDK with no functional changes

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 "note" diagnostic, but this did not represent a regression.
generate ✅

grid-python studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ✅test ✅

pip install https://pkg.stainless.com/s/grid-python/43c1d89b9307948d2488ac52fa8826e7417cf602/grid-0.0.1-py3-none-any.whl
grid-kotlin studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ✅test ✅

grid-typescript studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ✅test ✅

npm install https://pkg.stainless.com/s/grid-typescript/f4848a755e61070775238b1a86055d11419628e6/dist.tar.gz

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-02-20 23:53:20 UTC

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 20, 2026

Greptile Summary

Extracted 15 inline schema definitions into reusable components under components/schemas, replacing them with $ref references in path definitions.

  • New schema components: Created dedicated schema files for request/response types across config, customers, invitations, sandbox, tokens, transactions, and transfers endpoints
  • Path updates: Updated 15 endpoint path files to reference the new schema components instead of inline definitions
  • Bundled files: Regenerated both openapi.yaml and mintlify/openapi.yaml to reflect the refactored structure
  • Schema integrity: All schemas preserve exact structure, validation rules, and examples from original inline definitions
  • Reference paths: All $ref paths use correct relative paths (e.g., ../../components/schemas/...)

This follows OpenAPI best practices by centralizing schema definitions, reducing duplication, and improving code generation compatibility.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The refactoring is a straightforward structural improvement that extracts inline schemas to reusable components without changing any API behavior, validation rules, or examples. All $ref paths are correct, schemas match their inline counterparts exactly, and the bundled specs were properly regenerated.
  • No files require special attention

Important Files Changed

Filename Overview
openapi/components/schemas/config/PlatformConfigUpdateRequest.yaml Extracted inline schema for platform config updates to reusable component
openapi/components/schemas/customers/BulkCustomerImportJobAccepted.yaml Extracted inline schema for bulk import job response
openapi/components/schemas/invitations/UmaInvitationCreateRequest.yaml Extracted inline schema for UMA invitation creation request
openapi/components/schemas/sandbox/SandboxUmaReceiveRequest.yaml Extracted inline schema for sandbox UMA receive request
openapi/components/schemas/tokens/ApiTokenCreateRequest.yaml Extracted inline schema for API token creation request
openapi/components/schemas/transactions/ApprovePaymentRequest.yaml Extracted inline schema for payment approval request
openapi/components/schemas/transfers/TransferInRequest.yaml Extracted inline schema for transfer-in request
openapi/components/schemas/transfers/TransferOutRequest.yaml Extracted inline schema for transfer-out request

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Path Files] -->|Before: Inline Schemas| B[Request/Response Definitions]
    A -->|After: $ref| C[components/schemas]
    
    C --> D[config/PlatformConfigUpdateRequest.yaml]
    C --> E[customers/KycLinkResponse.yaml]
    C --> F[customers/BulkCustomerImportJobAccepted.yaml]
    C --> G[invitations/UmaInvitationCreateRequest.yaml]
    C --> H[invitations/UmaInvitationClaimRequest.yaml]
    C --> I[sandbox/SandboxSendRequest.yaml]
    C --> J[sandbox/SandboxUmaReceiveRequest.yaml]
    C --> K[sandbox/SandboxFundRequest.yaml]
    C --> L[tokens/ApiTokenCreateRequest.yaml]
    C --> M[transactions/ApprovePaymentRequest.yaml]
    C --> N[transactions/RejectPaymentRequest.yaml]
    C --> O[transfers/TransferInRequest.yaml]
    C --> P[transfers/TransferOutRequest.yaml]
    
    D --> Q[Build Process]
    E --> Q
    F --> Q
    G --> Q
    H --> Q
    I --> Q
    J --> Q
    K --> Q
    L --> Q
    M --> Q
    N --> Q
    O --> Q
    P --> Q
    
    Q -->|Bundle| R[openapi.yaml]
    Q -->|Bundle| S[mintlify/openapi.yaml]
Loading

Last reviewed commit: 814f4b5

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