-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add Quote/Transaction discriminators and remove inline examples #129
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: 01-24-feat_flatten_lightningexternalaccountinfo_schema_split
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| type: object | ||
| required: | ||
| - destinationType | ||
| - accountId | ||
| properties: | ||
| destinationType: | ||
| type: string | ||
| const: ACCOUNT | ||
| description: Destination type identifier | ||
| accountId: | ||
| type: string | ||
| description: Destination account identifier | ||
| example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 | ||
| currency: | ||
| type: string | ||
| description: Currency code for the destination account | ||
| example: EUR | ||
| description: Destination account details |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| type: object | ||
| required: | ||
| - sourceType | ||
| - accountId | ||
| properties: | ||
| sourceType: | ||
| type: string | ||
| const: ACCOUNT | ||
| description: Source type identifier | ||
| accountId: | ||
| type: string | ||
| description: Source account identifier | ||
| example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 | ||
| description: Source account details |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| type: object | ||
| required: | ||
| - sourceType | ||
| - currency | ||
| properties: | ||
| sourceType: | ||
| type: string | ||
| const: REALTIME_FUNDING | ||
| description: Source type identifier | ||
| customerId: | ||
| type: string | ||
| description: >- | ||
| Source customer ID. If this transaction is being initiated on behalf of a customer, this is required. | ||
| If customerId is not provided, the quote will be created on behalf of the platform itself. | ||
| example: Customer:019542f5-b3e7-1d02-0000-000000000009 | ||
| currency: | ||
| type: string | ||
| description: >- | ||
| Currency code for the funding source. See | ||
| [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) | ||
| for the full list of supported fiat and crypto currencies. | ||
| example: USD | ||
| description: >- | ||
| Fund the quote using a real-time funding source (RTP, SEPA Instant, Spark, Stables, etc.). | ||
| This will require manual just-in-time funding using `paymentInstructions` in the response. | ||
| Because quotes expire quickly, this option is only valid for instant payment methods. Do not try | ||
| to fund a quote with a non-instant payment method (ACH, etc.). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| type: object | ||
| required: | ||
| - destinationType | ||
| - accountId | ||
| - currency | ||
| properties: | ||
| destinationType: | ||
| type: string | ||
| const: ACCOUNT | ||
| description: Destination type identifier | ||
| accountId: | ||
| type: string | ||
| description: Destination account identifier | ||
| example: a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 | ||
| currency: | ||
| type: string | ||
| description: >- | ||
| Currency code for the destination account. See | ||
| [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) | ||
| for the full list of supported fiat and crypto currencies. | ||
| example: EUR | ||
| description: Destination account details |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| type: object | ||
| required: | ||
| - destinationType | ||
| - externalAccountDetails | ||
| properties: | ||
| destinationType: | ||
| type: string | ||
| const: EXTERNAL_ACCOUNT_DETAILS | ||
| description: Destination type identifier | ||
| externalAccountDetails: | ||
| $ref: ../external_accounts/ExternalAccountCreateRequest.yaml | ||
| description: >- | ||
| A convenient destination option which adds the external account and creates | ||
| the quote in one step rather than first needing to call /external-accounts | ||
| to add the account. Useful for one-off payments to some destination. | ||
| See the external accounts endpoints for test values in sandbox mode. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| type: object | ||
| required: | ||
| - destinationType | ||
| - umaAddress | ||
| - currency | ||
| properties: | ||
| destinationType: | ||
| type: string | ||
| const: UMA_ADDRESS | ||
| description: Destination type identifier | ||
| umaAddress: | ||
| type: string | ||
| description: UMA address of the recipient | ||
| example: $receiver@uma.domain.com | ||
| currency: | ||
| type: string | ||
| description: >- | ||
| Currency code for the destination. See | ||
| [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) | ||
| for the full list of supported fiat and crypto currencies. | ||
| example: EUR | ||
| description: UMA address destination details |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,42 +1,10 @@ | ||||||||
| required: | ||||||||
| - sourceType | ||||||||
|
Comment on lines
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: openapi/components/schemas/quotes/QuoteSource.yaml
Line: 1:2
Comment:
`required` at the oneOf level is invalid OpenAPI syntax - the `required` keyword should only appear within an object's properties, not at the oneOf/anyOf/allOf level. Since `sourceType` is already required in both `QuoteAccountSource.yaml` and `QuoteRealtimeFundingSource.yaml`, these lines can be safely removed.
```suggestion
oneOf:
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||||
| oneOf: | ||||||||
| - title: Account | ||||||||
| type: object | ||||||||
| required: | ||||||||
| - accountId | ||||||||
| properties: | ||||||||
| accountId: | ||||||||
| type: string | ||||||||
| description: Source account identifier | ||||||||
| example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 | ||||||||
| currency: | ||||||||
| type: string | ||||||||
| description: >- | ||||||||
| Currency code for the funding source. See | ||||||||
| [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) | ||||||||
| for the full list of supported fiat and crypto currencies. | ||||||||
| example: USD | ||||||||
| description: Source account details | ||||||||
| - title: Real-time funding | ||||||||
| type: object | ||||||||
| required: | ||||||||
| - currency | ||||||||
| - customerId | ||||||||
| properties: | ||||||||
| customerId: | ||||||||
| type: string | ||||||||
| description: >- | ||||||||
| Source customer ID. If this transaction is being initiated on behalf of a customer, this is required. | ||||||||
| If customerId is not provided, the quote will be created on behalf of the platform itself. | ||||||||
| example: Customer:019542f5-b3e7-1d02-0000-000000000009 | ||||||||
| currency: | ||||||||
| type: string | ||||||||
| description: >- | ||||||||
| Currency code for the funding source. See | ||||||||
| [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) | ||||||||
| for the full list of supported fiat and crypto currencies. | ||||||||
| example: USD | ||||||||
| description: >- | ||||||||
| Fund the quote using a real-time funding source (RTP, SEPA Instant, Spark, Stables, etc.). | ||||||||
| This will require manual just-in-time funding using `paymentInstructions` in the response. | ||||||||
| Because quotes expire quickly, this option is only valid for instant payment methods. Do not try | ||||||||
| to fund a quote with a non-instant payment method (ACH, etc.). | ||||||||
| - $ref: ./QuoteAccountSource.yaml | ||||||||
| - $ref: ./QuoteRealtimeFundingSource.yaml | ||||||||
| discriminator: | ||||||||
| propertyName: sourceType | ||||||||
| mapping: | ||||||||
| ACCOUNT: ./QuoteAccountSource.yaml | ||||||||
| REALTIME_FUNDING: ./QuoteRealtimeFundingSource.yaml | ||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| type: object | ||
| required: | ||
| - destinationType | ||
| - umaAddress | ||
| properties: | ||
| destinationType: | ||
| type: string | ||
| const: UMA_ADDRESS | ||
| description: Destination type identifier | ||
| umaAddress: | ||
| type: string | ||
| description: UMA address of the recipient | ||
| example: $receiver@uma.domain.com | ||
| currency: | ||
| type: string | ||
| description: Currency code for the destination | ||
| example: EUR | ||
| counterpartyInformation: | ||
| type: object | ||
| description: >- | ||
| Information about the recipient, as required by the platform in their | ||
| configuration. | ||
| additionalProperties: true | ||
| example: | ||
| FULL_NAME: Jane Receiver | ||
| BIRTH_DATE: '1990-01-01' | ||
| NATIONALITY: FR | ||
| description: UMA address destination details |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| type: object | ||
| required: | ||
| - destinationType | ||
| - accountId | ||
| - currency | ||
| properties: | ||
| destinationType: | ||
| type: string | ||
| const: ACCOUNT | ||
| description: Destination type identifier | ||
| accountId: | ||
| type: string | ||
| description: Destination account identifier | ||
| example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 | ||
| currency: | ||
| type: string | ||
| description: Currency code for the destination account | ||
| example: EUR | ||
| description: Destination account details |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| type: object | ||
| required: | ||
| - sourceType | ||
| - accountId | ||
| - currency | ||
| properties: | ||
| sourceType: | ||
| type: string | ||
| const: ACCOUNT | ||
| description: Source type identifier | ||
| accountId: | ||
| type: string | ||
| description: Source account identifier | ||
| example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 | ||
| currency: | ||
| type: string | ||
| description: Currency code for the source account | ||
| example: USD | ||
| description: Source account details |
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.
requiredat the oneOf level is invalid OpenAPI syntax - therequiredkeyword should only appear within an object's properties, not at the oneOf/anyOf/allOf level. SincedestinationTypeis already required in bothQuoteAccountDestination.yamlandQuoteUmaAddressDestination.yaml, this line can be safely removed.Prompt To Fix With AI