Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
✱ Stainless preview buildsThis PR will update the kotlin openapi python typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-python studio · code · diff
✅ grid-typescript studio · code · diff
✅ grid-kotlin studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
Greptile SummaryFixed transaction schema inheritance by implementing proper polymorphic type handling using Key changes:
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| .stainless/stainless.yml | Adds Stainless config to remove type property from base Transaction schema during bundling |
| openapi/components/schemas/transactions/TransactionOneOf.yaml | New polymorphic schema using oneOf discriminator to properly handle transaction type variants |
| openapi/components/schemas/transactions/IncomingTransaction.yaml | Adds required type property with INCOMING enum to child schema for proper discrimination |
| openapi/components/schemas/transactions/OutgoingTransaction.yaml | Adds type property with OUTGOING enum and removes paymentInstructions from required fields |
| openapi/components/schemas/transactions/TransactionStatus.yaml | Adds SENT status enum value and comprehensive status documentation table |
Class Diagram
%%{init: {'theme': 'neutral'}}%%
classDiagram
Transaction <|-- IncomingTransaction
Transaction <|-- OutgoingTransaction
TransactionOneOf o-- IncomingTransaction
TransactionOneOf o-- OutgoingTransaction
class Transaction {
+string id
+TransactionStatus status
+TransactionType type
+TransactionDestination destination
+string customerId
+string platformCustomerId
+datetime settledAt
+datetime createdAt
+datetime updatedAt
+string description
+CounterpartyInformation counterpartyInformation
}
class TransactionOneOf {
<<oneOf>>
discriminator: type
INCOMING → IncomingTransaction
OUTGOING → OutgoingTransaction
}
class IncomingTransaction {
+enum type = INCOMING
+TransactionSource source
+CurrencyAmount receivedAmount
+ReconciliationInstructions reconciliationInstructions
+IncomingRateDetails rateDetails
+IncomingTransactionFailureReason failureReason
}
class OutgoingTransaction {
+enum type = OUTGOING
+TransactionSource source
+CurrencyAmount sentAmount
+CurrencyAmount receivedAmount
+number exchangeRate
+integer fees
+string quoteId
+PaymentInstructions[] paymentInstructions
+Refund refund
+OutgoingRateDetails rateDetails
+OutgoingTransactionFailureReason failureReason
}
Last reviewed commit: c774ff0
2e13aea to
36ee105
Compare
36ee105 to
c774ff0
Compare
| - $ref: ./Transaction.yaml | ||
| - type: object | ||
| required: | ||
| - type |
There was a problem hiding this comment.
Check that removing paymentInstructions from required fields is intentional and won't break existing clients
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/transactions/OutgoingTransaction.yaml
Line: 5
Comment:
Check that removing `paymentInstructions` from required fields is intentional and won't break existing clients
How can I resolve this? If you propose a fix, please make it concise.
TL;DR
Fixed transaction schema inheritance by implementing proper polymorphic type handling for transactions.
What changed?
typeproperty from the baseTransactionschema to avoid conflicts when merging with child schemastypeproperty with specific enum values to bothIncomingTransactionandOutgoingTransactionschemasTransactionOneOfschema that uses proper polymorphic discrimination between transaction typesTransactionOneOfinstead of the baseTransactionschemaHow to test?
Why make this change?
The previous schema structure had conflicting type definitions when the base
Transactionschema was merged with specific transaction type schemas throughallOf. This change implements proper polymorphic inheritance using theoneOfdiscriminator pattern, ensuring that transaction types are correctly differentiated and validated. This prevents potential issues with schema validation and improves API documentation clarity.