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

@greptile-apps
Copy link

greptile-apps bot commented Jan 24, 2026

Greptile Overview

Greptile Summary

This PR adds Stainless SDK generation configuration to enable automatic TypeScript and Kotlin SDK generation from the OpenAPI specification.

Key changes:

  • Added .stainless/stainless.yml with comprehensive SDK configuration including resource definitions, authentication setup, pagination, and error handling
  • Added .stainless/workspace.json pointing to mintlify/openapi.yaml as the source spec
  • Created AllErrors union schema combining all HTTP error variants (Error400-Error501) to enable Stainless's error transformation feature
  • Renamed Error schema to GridError and updated references to avoid naming conflicts
  • Fixed phoneNumber example in UltimateBeneficialOwner to include '+' prefix, properly matching the E.164 format pattern
  • Corrected InternalAccount schema reference from users/ to customers/ directory
  • Updated .redocly.lint-ignore.yaml to suppress warnings for AllErrors (intentionally unused in the spec itself, only used by Stainless) and QuoteSource/Quote required properties

Architecture notes:
The Stainless configuration uses the splitSchemasByEnumProperty transformation to convert the AllErrors union into distinct error types based on the code enum property. This enables strongly-typed error handling in generated SDKs where each error code becomes a separate catchable type.

Confidence Score: 5/5

  • This PR is safe to merge with no blocking issues
  • All changes are configuration and schema cleanup with no breaking API changes. The Error→GridError rename maintains backward compatibility through proper schema references, schema paths are corrected, and the phone number format fix aligns the example with existing validation patterns
  • No files require special attention

Important Files Changed

Filename Overview
.stainless/stainless.yml Added Stainless SDK configuration for TypeScript and Kotlin SDK generation with comprehensive resource definitions, authentication settings, and error handling
.stainless/workspace.json Added workspace configuration pointing to mintlify/openapi.yaml for SDK generation with TypeScript target output path
openapi/components/schemas/customers/UltimateBeneficialOwner.yaml Fixed phoneNumber example to include '+' prefix matching E.164 format requirements
openapi/openapi.yaml Added AllErrors union schema containing all HTTP error code variants (400-501) for SDK error handling
openapi/paths/internal-accounts/internal_accounts.yaml Fixed InternalAccount schema reference path from users/ to customers/ directory

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Stainless as Stainless SDK Generator
    participant OpenAPI as OpenAPI Spec
    participant SDK as Generated SDK
    
    Dev->>OpenAPI: Add AllErrors union schema
    Dev->>OpenAPI: Rename Error → GridError
    Dev->>OpenAPI: Fix schema references
    Dev->>OpenAPI: Fix phone number format
    
    Dev->>Stainless: Configure stainless.yml
    Note over Stainless: Define resources, auth,<br/>error handling config
    
    Dev->>Stainless: Configure workspace.json
    Note over Stainless: Point to mintlify/openapi.yaml<br/>Set output paths
    
    Stainless->>OpenAPI: Read mintlify/openapi.yaml
    Stainless->>Stainless: Transform AllErrors by enum property
    Note over Stainless: splitSchemasByEnumProperty<br/>creates typed error classes
    
    Stainless->>SDK: Generate TypeScript SDK
    Stainless->>SDK: Generate Kotlin SDK
    
    SDK->>SDK: Include typed error handling
    Note over SDK: Each error code becomes<br/>a distinct type
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
- 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 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
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