Skip to content

Conversation

@lightspark-copybara
Copy link

Auto-synced external account schemas from webdev.

These schemas are generated from VASP adapter field definitions in sparkcore.

Please review the changes before merging.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 10, 2026

Greptile Overview

Greptile Summary

This PR auto-syncs new external account OpenAPI schemas for additional fiat corridors (e.g., BRL/THB/USD/etc.) and updates ExternalAccountInfoOneOf.yaml to include them in the ExternalAccountInfo union via oneOf + a discriminator on accountType.

Main concern is that ExternalAccountInfoOneOf.yaml now mixes legacy *AccountExternalAccountInfo.yaml schemas with newly added *AccountInfo.yaml schemas for the same currencies (GBP/SGD/PHP). That creates duplicate oneOf variants and a discriminator mapping that still resolves those account types to the old schemas, which can lead to ambiguous validation and inconsistent code generation.

Confidence Score: 3/5

  • This PR has a schema composition issue that should be fixed before merging.
  • Most changes are additive schema files, but ExternalAccountInfoOneOf.yaml now contains duplicate oneOf entries for GBP/SGD/PHP and a discriminator mapping that still points to the legacy variants, which can break validation/codegen for ExternalAccountInfo.
  • openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml

Important Files Changed

Filename Overview
openapi/components/schemas/external_accounts/BrlAccountInfo.yaml Adds new BRL Account schema with Pix rail, BRL const receivingCurrency, and beneficiary object.
openapi/components/schemas/external_accounts/DkkAccountInfo.yaml Adds new DKK Account schema with Sepa rail, DKK const receivingCurrency, and IBAN/SWIFT fields.
openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml Updates oneOf list and discriminator mapping; introduces duplicate titles and mixes new *AccountInfo.yaml variants alongside existing *ExternalAccountInfo.yaml refs.
openapi/components/schemas/external_accounts/GbpAccountInfo.yaml Adds new GBP Account schema with Local rail, GBP const receivingCurrency, and sortCode/accountNumber.
openapi/components/schemas/external_accounts/HkdAccountInfo.yaml Adds new HKD Account schema with Local rail, HKD const receivingCurrency, and bankName/accountNumber.
openapi/components/schemas/external_accounts/IdrAccountInfo.yaml Adds new IDR Account schema with Local rail and beneficiary object.
openapi/components/schemas/external_accounts/InrAccountInfo.yaml Adds new INR Account schema with Upi rail and vpa field plus beneficiary.
openapi/components/schemas/external_accounts/MxnAccountInfo.yaml Adds new MXN Account schema with Local rail and CLABE field plus beneficiary.
openapi/components/schemas/external_accounts/MyrAccountInfo.yaml Adds new MYR Account schema with Local rail and bankName/accountNumber plus beneficiary.
openapi/components/schemas/external_accounts/PhpAccountInfo.yaml Adds new PHP Account schema with Local rail and bankName/accountNumber plus beneficiary.
openapi/components/schemas/external_accounts/SgdAccountInfo.yaml Adds new SGD Account schema with Local rail and bankName/accountNumber plus beneficiary.
openapi/components/schemas/external_accounts/ThbAccountInfo.yaml Adds new THB Account schema with Local rail and bankName/accountNumber plus beneficiary.
openapi/components/schemas/external_accounts/UsdAccountInfo.yaml Adds new USD Account schema with RTP/ACH rails and account/routing numbers; beneficiary now requires birthDate/fullName/nationality.
openapi/components/schemas/external_accounts/VndAccountInfo.yaml Adds new VND Account schema with Local rail and bankName/accountNumber plus beneficiary.

Sequence Diagram

sequenceDiagram
  participant Client
  participant API as Grid API
  participant OAS as OpenAPI Schema

  Client->>API: POST /... (ExternalAccountInfo payload)
  API->>OAS: Validate ExternalAccountInfo
  OAS->>OAS: oneOf + discriminator(accountType)
  alt accountType = GBP_ACCOUNT/PHP_ACCOUNT/SGD_ACCOUNT
    OAS-->>OAS: mapping resolves to *AccountExternalAccountInfo.yaml
    Note over OAS: oneOf also contains *AccountInfo.yaml for same types
  else accountType = new corridors (e.g. BRL_ACCOUNT)
    OAS-->>OAS: mapping resolves to *AccountInfo.yaml
  end
  OAS-->>API: Validation result / chosen schema
  API-->>Client: 2xx or 4xx
Loading

Copy link
Contributor

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

14 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +16 to +21
- title: GBP Account
$ref: ./GbpAccountExternalAccountInfo.yaml
- title: PHP Account
$ref: ./PhpAccountExternalAccountInfo.yaml
- title: SGD Account
$ref: ./SgdAccountExternalAccountInfo.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate oneOf variants
ExternalAccountInfoOneOf.yaml now includes both the legacy Gbp/Php/SgdAccountExternalAccountInfo.yaml refs (lines 16-21) and the new Gbp/Php/SgdAccountInfo.yaml refs (lines 40-45, 56-57) for the same account types. This makes the oneOf ambiguous and can break schema validation/codegen for ExternalAccountInfo; one of the two sets should be removed or reconciled.

Also appears at: openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml:40-45,56-57.

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

Comment:
**Duplicate oneOf variants**
`ExternalAccountInfoOneOf.yaml` now includes *both* the legacy `Gbp/Php/SgdAccountExternalAccountInfo.yaml` refs (lines 16-21) and the new `Gbp/Php/SgdAccountInfo.yaml` refs (lines 40-45, 56-57) for the same account types. This makes the `oneOf` ambiguous and can break schema validation/codegen for `ExternalAccountInfo`; one of the two sets should be removed or reconciled.

Also appears at: `openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml:40-45,56-57`.

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

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 10, 2026

Additional Comments (1)

openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml
Discriminator points to old schemas
The discriminator mapping for GBP_ACCOUNT/PHP_ACCOUNT/SGD_ACCOUNT still resolves to the legacy *AccountExternalAccountInfo.yaml schemas (lines 70-72), but oneOf now also includes the new *AccountInfo.yaml variants for those same accountType enums. With a discriminator present, clients will pick the mapped (old) schema, leaving the new schemas inconsistent/unused. Consider updating the mapping (or removing the new oneOf entries) so each accountType resolves to exactly one schema.

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

Comment:
**Discriminator points to old schemas**
The discriminator mapping for `GBP_ACCOUNT`/`PHP_ACCOUNT`/`SGD_ACCOUNT` still resolves to the legacy `*AccountExternalAccountInfo.yaml` schemas (lines 70-72), but `oneOf` now also includes the new `*AccountInfo.yaml` variants for those same `accountType` enums. With a discriminator present, clients will pick the mapped (old) schema, leaving the new schemas inconsistent/unused. Consider updating the mapping (or removing the new oneOf entries) so each `accountType` resolves to exactly one schema.

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.

0 participants