Skip to content

chore: Sync account schemas#418

Merged
JasonCWang merged 1 commit intomainfrom
auto/sync-grid-schemas-20260429-012744
Apr 29, 2026
Merged

chore: Sync account schemas#418
JasonCWang merged 1 commit intomainfrom
auto/sync-grid-schemas-20260429-012744

Conversation

@lightspark-copybara
Copy link
Copy Markdown
Contributor

Auto-synced account schemas.

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

Synced schemas:

  • common/ — per-currency account info, beneficiary, and payment account schemas
  • common/PaymentInstructions.yaml — payment instructions oneOf (new currencies added)
  • external_accounts/ — per-currency external account schemas (reference common/)

Please review the changes before merging.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
grid-flow-builder Ready Ready Preview, Comment Apr 29, 2026 1:28am

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

✱ Stainless preview builds

This PR will update the grid SDKs with the following commit messages.

kotlin

fix(types): make accountNumber/phoneNumber/bankName optional in BDT/GHS/PKR account models

openapi

fix(types): make accountNumber/phoneNumber/bankName conditionally optional in payment accounts

python

fix(types): make account_number, phone_number, bank_name optional in BDT/GHS/PKR types

typescript

fix(types): make fields optional in BDT/GHS/PKR account types
grid-kotlin studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

grid-openapi studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅

grid-typescript studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

npm install https://pkg.stainless.com/s/grid-typescript/75b1675f61d88b0657e36f8b4e3fe569dd0b1eda/dist.tar.gz
grid-python studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

pip install https://pkg.stainless.com/s/grid-python/a8bce986c7f47c7a9459abb61b1ea1c70d9338a6/grid-0.0.1-py3-none-any.whl

This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-04-29 03:26:58 UTC

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 29, 2026

Greptile Summary

This PR syncs auto-generated account info schemas for BDT, GHS, and PKR currencies, replacing rail-specific required field lists with a prose description that documents conditional requirements based on paymentRails.

  • Validation gap: Removing accountNumber, phoneNumber, and bankName from required makes them unconditionally optional in the OpenAPI schema. Clients and validators will no longer flag missing fields for a given payment rail — the description text is not machine-enforceable. Consider using oneOf sub-schemas or if/then/else to express conditional required fields properly.

Confidence Score: 3/5

PR weakens schema validation by making rail-critical fields unconditionally optional with no machine-readable conditional enforcement.

A single P1 finding (required fields dropped with no conditional schema replacement) reduces the ceiling to 4, and the impact is broad — three currency schemas and both composed openapi.yaml files are affected — warranting a score below the P1 ceiling.

openapi/components/schemas/common/BdtAccountInfoBase.yaml, GhsAccountInfoBase.yaml, PkrAccountInfoBase.yaml — all three drop required fields without conditional validation.

Important Files Changed

Filename Overview
openapi/components/schemas/common/BdtAccountInfoBase.yaml Removes accountNumber and phoneNumber from required; replaces with prose description. No machine-readable conditional validation is added.
openapi/components/schemas/common/GhsAccountInfoBase.yaml Removes accountNumber and phoneNumber from required; replaces with prose description. Same concern as BdtAccountInfoBase.
openapi/components/schemas/common/PkrAccountInfoBase.yaml Removes accountNumber, phoneNumber, and bankName from required; replaces with prose description. Same concern as BdtAccountInfoBase.
openapi.yaml Mirrors the same required-field removals as the individual schema files for BDT, GHS, and PKR schemas.
mintlify/openapi.yaml Mirrors the same required-field removals as openapi.yaml — kept in sync as expected.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[API Consumer submits account info] --> B{paymentRails?}
    B -->|BANK_TRANSFER| C[Needs: accountNumber]
    B -->|MOBILE_MONEY| D[Needs: phoneNumber\nPKR also needs: bankName]
    C --> E{Schema validation\nold: required array}
    D --> E
    E -->|accountNumber + phoneNumber required| F[✅ Catches missing fields]
    C --> G{Schema validation\nnew: prose description only}
    D --> G
    G -->|only accountType required| H[⚠️ Missing fields pass silently]
Loading

Fix All in Claude Code

Prompt To Fix All With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/BdtAccountInfoBase.yaml
Line: 1-8

Comment:
**Conditional requirements not machine-readable**

`accountNumber` and `phoneNumber` were removed from the `required` array and replaced with a prose `description`. OpenAPI schema validators and code generators treat these fields as entirely optional now — the description comment carries no enforcement weight. A client that omits `accountNumber` on a `BANK_TRANSFER` rail will pass schema validation silently.

The idiomatic way to express rail-conditional required fields in OpenAPI 3.x is `oneOf` (or `if/then/else`):

```yaml
oneOf:
  - description: BANK_TRANSFER
    required:
      - accountType
      - accountNumber
    properties:
      ...
  - description: MOBILE_MONEY
    required:
      - accountType
      - phoneNumber
    properties:
      ...
```

The same pattern applies to `GhsAccountInfoBase.yaml` and `PkrAccountInfoBase.yaml`.

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

Reviews (1): Last reviewed commit: "chore: Sync account schemas" | Re-trigger Greptile

Comment on lines 1 to +8
type: object
required:
- accountType
- accountNumber
- phoneNumber
description: 'Required fields depend on the selected paymentRails:
- BANK_TRANSFER: accountNumber
- MOBILE_MONEY: phoneNumber'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Conditional requirements not machine-readable

accountNumber and phoneNumber were removed from the required array and replaced with a prose description. OpenAPI schema validators and code generators treat these fields as entirely optional now — the description comment carries no enforcement weight. A client that omits accountNumber on a BANK_TRANSFER rail will pass schema validation silently.

The idiomatic way to express rail-conditional required fields in OpenAPI 3.x is oneOf (or if/then/else):

oneOf:
  - description: BANK_TRANSFER
    required:
      - accountType
      - accountNumber
    properties:
      ...
  - description: MOBILE_MONEY
    required:
      - accountType
      - phoneNumber
    properties:
      ...

The same pattern applies to GhsAccountInfoBase.yaml and PkrAccountInfoBase.yaml.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/BdtAccountInfoBase.yaml
Line: 1-8

Comment:
**Conditional requirements not machine-readable**

`accountNumber` and `phoneNumber` were removed from the `required` array and replaced with a prose `description`. OpenAPI schema validators and code generators treat these fields as entirely optional now — the description comment carries no enforcement weight. A client that omits `accountNumber` on a `BANK_TRANSFER` rail will pass schema validation silently.

The idiomatic way to express rail-conditional required fields in OpenAPI 3.x is `oneOf` (or `if/then/else`):

```yaml
oneOf:
  - description: BANK_TRANSFER
    required:
      - accountType
      - accountNumber
    properties:
      ...
  - description: MOBILE_MONEY
    required:
      - accountType
      - phoneNumber
    properties:
      ...
```

The same pattern applies to `GhsAccountInfoBase.yaml` and `PkrAccountInfoBase.yaml`.

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

Fix in Claude Code

@JasonCWang JasonCWang merged commit aaffef5 into main Apr 29, 2026
8 checks passed
@JasonCWang JasonCWang deleted the auto/sync-grid-schemas-20260429-012744 branch April 29, 2026 03:20
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.

1 participant