Skip to content

Conversation

@pengying
Copy link
Contributor

No description provided.

@greptile-apps
Copy link

greptile-apps bot commented Jan 22, 2026

Greptile Summary

This PR updates OpenAPI schemas to be compatible with Stainless SDK code generation, primarily by changing discriminator fields from enum to const for better type safety. It also adds Stainless configuration files and fixes the Lightning external account discriminator.

Key changes:

  • Added Stainless SDK configuration (.stainless/stainless.yml and workspace.json) for TypeScript code generation
  • Changed accountType fields from enum to const across 29 schema files for more precise typing
  • Added destinationType discriminator to LightningExternalAccountInfo to distinguish between INVOICE, BOLT12, and LIGHTNING_ADDRESS
  • Removed references to PaymentAccountOrWalletInfo.yaml from most Payment* schemas
  • Changed error schema status/code fields from enum to const

Critical issue found:

  • PaymentLightningInvoiceInfo.yaml still references the removed PaymentAccountOrWalletInfo.yaml, which will cause schema resolution to fail

Minor issues:

  • Multiple YAML files missing trailing newlines (POSIX standard)

Confidence Score: 1/5

  • This PR cannot be merged due to a broken schema reference that will cause build failures
  • The PR contains a critical bug where PaymentLightningInvoiceInfo.yaml still references PaymentAccountOrWalletInfo.yaml that was intentionally removed from all other Payment* schemas. This will cause schema resolution errors and break the OpenAPI spec bundling process, preventing Stainless SDK generation from working.
  • Critical: openapi/components/schemas/common/PaymentLightningInvoiceInfo.yaml - must remove the PaymentAccountOrWalletInfo reference. Minor: 10 YAML files need trailing newlines added.

Important Files Changed

Filename Overview
openapi/components/schemas/common/PaymentLightningInvoiceInfo.yaml Still references removed PaymentAccountOrWalletInfo.yaml, will cause schema resolution failure
openapi/components/schemas/external_accounts/LightningExternalAccountInfo.yaml Added proper discriminator for lightning destination types (INVOICE, BOLT12, LIGHTNING_ADDRESS)
.stainless/stainless.yml New Stainless SDK configuration for TypeScript code generation
openapi/components/schemas/common/PaymentFboAccountInfo.yaml Removed PaymentAccountOrWalletInfo reference, added explicit accountType const

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Stainless as Stainless SDK Generator
    participant OpenAPI as OpenAPI Spec
    participant Schemas as Schema Files
    
    Dev->>OpenAPI: Update schemas for code generation
    Dev->>Schemas: Change enum to const for discriminators
    Note over Schemas: accountType: const instead of enum
    Dev->>Schemas: Add discriminator to LightningExternalAccountInfo
    Note over Schemas: destinationType discriminator for INVOICE/BOLT12/LIGHTNING_ADDRESS
    Dev->>Schemas: Remove PaymentAccountOrWalletInfo refs
    Note over Schemas: Most files updated, but PaymentLightningInvoiceInfo missed
    Dev->>Stainless: Add stainless.yml config
    Dev->>Stainless: Add workspace.json
    Stainless->>OpenAPI: Read spec from mintlify/openapi.yaml
    OpenAPI->>Schemas: Resolve schema references
    Schemas-->>OpenAPI: ❌ PaymentLightningInvoiceInfo fails
    Note over Schemas,OpenAPI: Reference to removed PaymentAccountOrWalletInfo.yaml
    Stainless-->>Dev: ❌ Code generation fails
Loading

Copy link

@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.

Additional Comments (1)

  1. openapi/components/schemas/common/PaymentLightningInvoiceInfo.yaml, line 2 (link)

    logic: This file still references ./PaymentAccountOrWalletInfo.yaml but all other Payment* schemas had this reference removed. This will cause schema resolution errors.

55 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

description: A lightning address which can be used as a payment destination. Note that for UMA addresses, no external account is needed. You can use the UMA address directly as a destination.
example: john.doe@lightningwallet.com
discriminator:
propertyName: destinationType
Copy link

Choose a reason for hiding this comment

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

style: Missing newline at end of file (POSIX standard). Many other modified YAML files have the same issue.

Suggested change
propertyName: destinationType
propertyName: destinationType

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/LightningExternalAccountInfo.yaml
Line: 50:50

Comment:
**style:** Missing newline at end of file (POSIX standard). Many other modified YAML files have the same issue.

```suggestion
      propertyName: destinationType

```

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

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

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