Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions mintlify/openapi.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions openapi.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions openapi/components/schemas/common/BdtAccountInfoBase.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
type: object
required:
- accountType
- accountNumber
- phoneNumber
description: 'Required fields depend on the selected paymentRails:

- BANK_TRANSFER: accountNumber

- MOBILE_MONEY: phoneNumber'
Comment on lines 1 to +8
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

properties:
accountType:
type: string
Expand Down
7 changes: 5 additions & 2 deletions openapi/components/schemas/common/GhsAccountInfoBase.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
type: object
required:
- accountType
- accountNumber
- phoneNumber
description: 'Required fields depend on the selected paymentRails:

- BANK_TRANSFER: accountNumber

- MOBILE_MONEY: phoneNumber'
properties:
accountType:
type: string
Expand Down
8 changes: 5 additions & 3 deletions openapi/components/schemas/common/PkrAccountInfoBase.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
type: object
required:
- accountType
- accountNumber
- phoneNumber
- bankName
description: 'Required fields depend on the selected paymentRails:

- BANK_TRANSFER: accountNumber

- MOBILE_MONEY: bankName, phoneNumber'
properties:
accountType:
type: string
Expand Down
Loading