Conversation
Greptile SummaryThis PR configures multi-language SDK generation with proper package naming (
The transformation strategy shift (removing discriminators from base schemas rather than variants) resolves the type conflicts more elegantly but differs from the previous pattern, which was already flagged in previous review threads. Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| .stainless/stainless.yml | Comprehensive SDK configuration update adding Python support, updating package names to @lightsparkdev namespace, configuring multi-language publishing, adding webhook unwrapping, and refactoring OpenAPI transformations to fix type discriminator conflicts |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Stainless Configuration] --> B[Multi-Language SDK Generation]
B --> C[TypeScript SDK]
B --> D[Kotlin SDK]
B --> E[Python SDK]
C --> C1[Package: @lightsparkdev/grid]
C --> C2[NPM Publishing via OIDC]
C --> C3[Repo: grid-js-sdk]
C --> C4[MCP Server: @lightsparkdev/grid-mcp]
D --> D1[Package: com.lightspark.grid]
D --> D2[Maven via Sonatype Portal]
D --> D3[Repo: grid-kotlin-sdk]
E --> E1[Package: grid]
E --> E2[PyPI disabled]
E --> E3[No repo yet]
A --> F[Environment Variables]
F --> F1[GRID_CLIENT_ID]
F --> F2[GRID_CLIENT_SECRET]
F --> F3[GRID_WEBHOOK_PUBKEY]
A --> G[Webhook Configuration]
G --> G1[Webhook Unwrapping]
G --> G2[Type Discriminator: type]
G --> G3[Test Endpoint moved to sandbox]
A --> H[OpenAPI Transformations]
H --> H1[Remove discriminators from base schemas]
H --> H2[Remove empty base $refs]
H --> H3[Fix allOf type conflicts]
Last reviewed commit: 6cb6a95
| sandbox: | ||
| methods: | ||
| send_funds: post /sandbox/send | ||
| send_test_webhook: post /webhooks/test |
There was a problem hiding this comment.
verify that generated SDK docs properly reflect this endpoint move from webhooks.send_test() to sandbox.send_test_webhook() to avoid breaking existing client code
Prompt To Fix With AI
This is a comment left during a code review.
Path: .stainless/stainless.yml
Line: 232:232
Comment:
verify that generated SDK docs properly reflect this endpoint move from `webhooks.send_test()` to `sandbox.send_test_webhook()` to avoid breaking existing client code
How can I resolve this? If you propose a fix, please make it concise.15b6eed to
d3349f8
Compare
| - command: remove | ||
| reason: >- | ||
| Remove inline destinationType enums from transaction and quote | ||
| destination allOf variants to avoid conflicting types with their | ||
| base schemas which define destinationType via shared $ref enums | ||
| args: | ||
| unionPath: AllErrors | ||
| enumProperty: code | ||
| # ── customerType: IndividualCustomerFields / BusinessCustomerFields ── | ||
| target: | ||
| - "$.components.schemas.AccountTransactionDestination.allOf[0]" | ||
| - "$.components.schemas.UmaAddressTransactionDestination.allOf[0]" | ||
| keys: [ "$ref" ] |
There was a problem hiding this comment.
Check that this transformation correctly removes the base schema reference. Removing $ref from allOf[0] is different from the pattern used in other transformations (which remove discriminator properties). Verify the generated SDK handles this correctly.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .stainless/stainless.yml
Line: 410:419
Comment:
Check that this transformation correctly removes the base schema reference. Removing `$ref` from `allOf[0]` is different from the pattern used in other transformations (which remove discriminator properties). Verify the generated SDK handles this correctly.
How can I resolve this? If you propose a fix, please make it concise.d3349f8 to
62e3952
Compare
| read_env: GRID_CLIENT_ID | ||
| password: | ||
| type: string | ||
| nullable: false | ||
| auth: | ||
| security_scheme: BasicAuth | ||
| role: password | ||
| description: API token authentication using format `<api token id>:<api client secret>` | ||
| read_env: GRID_PASSWORD | ||
| read_env: GRID_CLIENT_SECRET |
There was a problem hiding this comment.
Environment variable names changed from GRID_USERNAME/GRID_PASSWORD to GRID_CLIENT_ID/GRID_CLIENT_SECRET. Check that these are updated in all deployment environments (production, staging, CI/CD pipelines) before merging to prevent authentication failures.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .stainless/stainless.yml
Line: 283-291
Comment:
Environment variable names changed from `GRID_USERNAME`/`GRID_PASSWORD` to `GRID_CLIENT_ID`/`GRID_CLIENT_SECRET`. Check that these are updated in all deployment environments (production, staging, CI/CD pipelines) before merging to prevent authentication failures.
How can I resolve this? If you propose a fix, please make it concise.| python: | ||
| edition: python.2025-11-20 | ||
| package_name: grid | ||
| production_repo: null | ||
| publish: | ||
| maven: false | ||
| pypi: false |
There was a problem hiding this comment.
Python SDK has production_repo: null and pypi: false. When ready to publish, ensure the production repo is created and PyPI publishing is enabled with proper authentication configured.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .stainless/stainless.yml
Line: 44-49
Comment:
Python SDK has `production_repo: null` and `pypi: false`. When ready to publish, ensure the production repo is created and PyPI publishing is enabled with proper authentication configured.
How can I resolve this? If you propose a fix, please make it concise.| methods: | ||
| send_test: post /webhooks/test | ||
| unwrap: | ||
| type: webhook_unwrap | ||
| discriminator: type | ||
|
|
There was a problem hiding this comment.
added webhook unwrapping functionality with type discriminator, allowing SDKs to parse webhook payloads into strongly-typed objects based on the type field
Prompt To Fix With AI
This is a comment left during a code review.
Path: .stainless/stainless.yml
Line: 214-218
Comment:
added webhook unwrapping functionality with type discriminator, allowing SDKs to parse webhook payloads into strongly-typed objects based on the `type` field
How can I resolve this? If you propose a fix, please make it concise.
TL;DR
Updated Stainless configuration to prepare for SDK publishing across multiple languages with proper package naming and repository references.
What changed?
Changed organization name from "grid" to "Lightspark Grid"
Updated TypeScript configuration:
Updated Kotlin configuration:
Added Python configuration:
Simplified model references by commenting out unused schemas
Updated external account models with more consistent naming
Added webhook unwrapping functionality
Moved webhook test endpoint to sandbox resource
Updated environment variable names to use GRID_CLIENT_ID and GRID_CLIENT_SECRET
Fixed OpenAPI transformations to properly handle type discriminators
How to test?
Why make this change?
This change prepares the Grid API SDKs for proper publishing across multiple language ecosystems with consistent naming and structure. It improves the developer experience by providing better organized packages and fixing type discriminator issues that could cause compilation problems. The configuration now properly reflects the Lightspark branding and repository structure, making it ready for production use.