-
Notifications
You must be signed in to change notification settings - Fork 3
Fixing OpenAPI for stainless code gen #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Greptile SummaryThis PR updates OpenAPI schemas to be compatible with Stainless SDK code generation, primarily by changing discriminator fields from Key changes:
Critical issue found:
Minor issues:
Confidence Score: 1/5
|
| 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
openapi/components/schemas/common/PaymentLightningInvoiceInfo.yaml, line 2 (link)logic: This file still references
./PaymentAccountOrWalletInfo.yamlbut all other Payment* schemas had this reference removed. This will cause schema resolution errors.
55 files reviewed, 2 comments
| 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 |
There was a problem hiding this comment.
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.
| 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.
No description provided.