Skip to content

Conversation

@pengying
Copy link
Contributor

@pengying pengying commented Jan 24, 2026

Grid API SDK Configuration

  • Add .stainless/stainless.yml and workspace.json for SDK generation
  • Add AllErrors schema to properly handle error types
  • Replace Error schema references with GridError
  • Fix phone number format in UltimateBeneficialOwner to include '+' prefix
  • Update .redocly.lint-ignore.yaml with additional rule exceptions
  • Fix internal_accounts schema reference path

Copy link
Contributor Author

pengying commented Jan 24, 2026

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 24, 2026

Greptile Overview

Greptile Summary

This PR adds Stainless SDK generation configuration and performs several OpenAPI schema cleanups to prepare for automated SDK generation.

Key Changes:

  • Added Stainless SDK configuration files (.stainless/stainless.yml and workspace.json) for TypeScript and Kotlin SDK generation
  • Added GitHub Actions workflow to automatically build SDK previews on PRs and merge builds
  • Introduced AllErrors schema as a union type of all error responses for better SDK error handling
  • Fixed InternalAccount schema reference path from non-existent users/InternalAccount to correct customers/InternalAccount
  • Updated phone number example in UltimateBeneficialOwner to include '+' prefix matching E.164 format
  • Added explicit type: string to umaAddress field in CustomerCreateRequest
  • Replaced generic Error schema with specific Error410 schema for customer deletion endpoint

Schema Improvements:
The AllErrors schema provides a discriminated union of all HTTP error types, which enables SDK generators like Stainless to create type-safe error handling. The Stainless config includes transformations to split this union by the code enum property, generating distinct error classes per error type.

Confidence Score: 5/5

  • This PR is safe to merge with no identified issues
  • All changes are configuration and documentation updates for SDK generation. The OpenAPI schema fixes are straightforward corrections (fixing broken references, adding missing type declarations, correcting examples). The Stainless configuration is comprehensive and properly structured. No runtime code changes or logic alterations that could introduce bugs.
  • No files require special attention

Important Files Changed

Filename Overview
.github/workflows/stainless-action.yml Added GitHub Actions workflow for Stainless SDK generation on PR events
.stainless/stainless.yml Added comprehensive Stainless SDK configuration for TypeScript and Kotlin targets
openapi/openapi.yaml Added AllErrors schema with refs to specific error schemas
openapi/components/schemas/customers/UltimateBeneficialOwner.yaml Fixed phone number example to include '+' prefix matching E.164 format
openapi/paths/internal-accounts/internal_accounts.yaml Fixed schema reference from non-existent users/InternalAccount to customers/InternalAccount

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant GH as GitHub PR
    participant Workflow as Stainless Action
    participant Stainless as Stainless API
    participant SDK as Generated SDK

    Dev->>GH: Opens/Updates PR
    GH->>Workflow: Trigger (opened/synchronize/reopened)
    Workflow->>Workflow: Checkout repository
    Workflow->>Stainless: Upload OpenAPI spec (preview)
    Stainless->>Stainless: Validate OpenAPI spec
    Stainless->>Stainless: Generate TypeScript SDK
    Stainless->>Stainless: Generate Kotlin SDK
    Stainless->>GH: Post preview comment on PR
    
    Dev->>GH: Merges PR
    GH->>Workflow: Trigger (closed + merged)
    Workflow->>Workflow: Checkout repository
    Workflow->>Stainless: Upload OpenAPI spec (merge)
    Stainless->>SDK: Build and publish SDKs
    Stainless->>GH: Post merge status
Loading

@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from 6432728 to e5749d2 Compare January 27, 2026 01:29
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch from 21d334e to f90918a Compare January 27, 2026 01:29
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from e5749d2 to a27f6e6 Compare January 27, 2026 05:19
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch from f90918a to c6b215b Compare January 27, 2026 05:19
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from a27f6e6 to a1379cd Compare January 27, 2026 05:24
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch from c6b215b to 6464d8a Compare January 27, 2026 05:25
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from a1379cd to d0f0475 Compare January 27, 2026 20:38
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch 2 times, most recently from 2d0527c to 16c31c5 Compare January 27, 2026 21:19
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch 2 times, most recently from 94a379a to c72b46f Compare January 27, 2026 23:54
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch from 16c31c5 to 20ea4a3 Compare January 27, 2026 23:54
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from c72b46f to 99a29c9 Compare January 27, 2026 23:57
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch from 20ea4a3 to d1566ae Compare January 27, 2026 23:57
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from 99a29c9 to d8d7c4d Compare January 28, 2026 00:08
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch 2 times, most recently from 7324f44 to 3aa1250 Compare January 28, 2026 00:15
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from 1c31c37 to fbf418e Compare January 28, 2026 00:27
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch from 3aa1250 to f054ac0 Compare January 28, 2026 00:27
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from fbf418e to 48e70c8 Compare January 28, 2026 04:32
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch from f054ac0 to 2ac3b42 Compare January 28, 2026 04:32
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch from 2ac3b42 to a8f4844 Compare February 5, 2026 16:43
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch 2 times, most recently from 00ab46b to fce8683 Compare February 5, 2026 18:00
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch from a8f4844 to 6b08d9b Compare February 5, 2026 18:00
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 5, 2026

Additional Comments (1)

openapi.yaml
Inconsistent error schema name

This PR renames #/components/schemas/Error to #/components/schemas/GridError in the bundled specs (openapi.yaml / mintlify/openapi.yaml), but the modular spec still references error schemas under openapi/components/schemas/errors/Error*.yaml and also uses common/GridError.yaml for a 410 response (openapi/paths/customers/customers_{customerId}.yaml:172). Since GridError and Error400/Error401 etc are separate shapes, it’s easy for clients to end up with inconsistent error typing depending on endpoint/status. Please confirm the intended canonical error model and update the remaining path/components refs so all non-2xx responses consistently use the same error schema family.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi.yaml
Line: 4444:4469

Comment:
**Inconsistent error schema name**

This PR renames `#/components/schemas/Error` to `#/components/schemas/GridError` in the bundled specs (`openapi.yaml` / `mintlify/openapi.yaml`), but the modular spec still references error schemas under `openapi/components/schemas/errors/Error*.yaml` and also uses `common/GridError.yaml` for a 410 response (`openapi/paths/customers/customers_{customerId}.yaml:172`). Since `GridError` and `Error400`/`Error401` etc are separate shapes, it’s easy for clients to end up with inconsistent error typing depending on endpoint/status. Please confirm the intended canonical error model and update the remaining path/components refs so all non-2xx responses consistently use the same error schema family.

How can I resolve this? If you propose a fix, please make it concise.

@pengying pengying changed the base branch from 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split to graphite-base/132 February 5, 2026 20:49
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch from 6b08d9b to 9eebf24 Compare February 5, 2026 20:50
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 5, 2026

Additional Comments (1)

openapi/paths/customers/customers_{customerId}.yaml
410 response schema mismatch

The 410 response now references ../../components/schemas/common/GridError.yaml, but the 401/404/500 responses in this same file still reference ../../components/schemas/errors/Error*.yaml. If 410 is meant to follow the standard error envelope used elsewhere, it should reference the appropriate errors/Error410.yaml schema; otherwise clients will have to special-case 410 to a different error shape than other error responses for this endpoint.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/paths/customers/customers_{customerId}.yaml
Line: 167:173

Comment:
**410 response schema mismatch**

The `410` response now references `../../components/schemas/common/GridError.yaml`, but the `401/404/500` responses in this same file still reference `../../components/schemas/errors/Error*.yaml`. If `410` is meant to follow the standard error envelope used elsewhere, it should reference the appropriate `errors/Error410.yaml` schema; otherwise clients will have to special-case `410` to a different error shape than other error responses for this endpoint.

How can I resolve this? If you propose a fix, please make it concise.

@graphite-app graphite-app bot changed the base branch from graphite-base/132 to main February 5, 2026 20:53
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch 3 times, most recently from 1c7be75 to a688a5a Compare February 5, 2026 21:01
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch from a688a5a to 741b5e2 Compare February 5, 2026 21:07
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 5, 2026

Additional Comments (2)

mintlify/openapi.yaml
Missing type for property

umaAddress is defined with description/example but no type in the schema, which makes the property schema invalid/ambiguous for OpenAPI tooling and SDK generation. Add type: string (matching the example and intended semantics).

Prompt To Fix With AI
This is a comment left during a code review.
Path: mintlify/openapi.yaml
Line: 4358:4360

Comment:
**Missing `type` for property**

`umaAddress` is defined with `description`/`example` but no `type` in the schema, which makes the property schema invalid/ambiguous for OpenAPI tooling and SDK generation. Add `type: string` (matching the example and intended semantics).

How can I resolve this? If you propose a fix, please make it concise.

openapi.yaml
Missing type for property

umaAddress is defined with description/example but no type. OpenAPI requires each property schema to be a valid schema object; without type this becomes ambiguous and can break validators/SDK generation. Add type: string for umaAddress (as done in the split schema).

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi.yaml
Line: 4369:4371

Comment:
**Missing `type` for property**

`umaAddress` is defined with `description`/`example` but no `type`. OpenAPI requires each property schema to be a valid schema object; without `type` this becomes ambiguous and can break validators/SDK generation. Add `type: string` for `umaAddress` (as done in the split schema).

How can I resolve this? If you propose a fix, please make it concise.

@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch from 741b5e2 to 65fb175 Compare February 5, 2026 22:21
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

✱ Stainless preview builds

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

feat: add Stainless SDK config and misc cleanups
grid-openapi studio · code

Your SDK built successfully.
generate ✅

⚠️ grid-typescript studio · code

There was a regression in your SDK.
generate ✅build ❗lint ❗test ✅

⚠️ grid-kotlin studio · code

There was a regression in your SDK.
generate ✅build ❗lint ✅test ❗


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-05 23:55:30 UTC

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

- Add .stainless/stainless.yml and workspace.json
- Add AllErrors schema and remove retry quotes endpoint
- Update .redocly.lint-ignore.yaml
- Fix UltimateBeneficialOwner phone format
- Fix internal_accounts ref path
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch from 65fb175 to c97f7ed Compare February 5, 2026 22:26
Copy link
Contributor Author

pengying commented Feb 5, 2026

Merge activity

  • Feb 5, 11:49 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 5, 11:49 PM UTC: @pengying merged this pull request with Graphite.

@pengying pengying merged commit 30fbd62 into main Feb 5, 2026
9 checks passed
@pengying pengying deleted the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split_split branch February 5, 2026 23:49
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