Skip to content

Commit a34c23d

Browse files
authored
feat: extracting inline schemas to their own schema objects for better code gen (#219)
### TL;DR Refactored OpenAPI specification by extracting inline schema definitions into reusable schema components. ### What changed? Extracted inline schema definitions from API endpoints into separate reusable schema components in the `components/schemas` section. This affects multiple endpoints including: - Platform configuration updates (`PlatformConfigUpdateRequest`) - Customer KYC links (`KycLinkResponse`) - Transfer operations (`TransferInRequest`, `TransferOutRequest`) - Payment approvals/rejections (`ApprovePaymentRequest`, `RejectPaymentRequest`) - Bulk customer imports (`BulkCustomerImportJobAccepted`) - UMA invitations (`UmaInvitationCreateRequest`, `UmaInvitationClaimRequest`) - Sandbox operations (`SandboxSendRequest`, `SandboxUmaReceiveRequest`, `SandboxFundRequest`) - API token creation (`ApiTokenCreateRequest`) Each inline schema definition was replaced with a `$ref` reference to the corresponding component schema. ### How to test? 1. Validate the OpenAPI specification using an OpenAPI validator 2. Generate API documentation to ensure all schemas render correctly 3. Test API client generation to verify schema references resolve properly 4. Verify that all endpoint request/response schemas maintain the same structure and validation rules ### Why make this change? This refactoring improves the OpenAPI specification by: - Reducing duplication of schema definitions - Making schemas reusable across multiple endpoints - Improving maintainability by centralizing schema definitions - Following OpenAPI best practices for schema organization - Making the specification more modular and easier to manage
1 parent 6b7473c commit a34c23d

28 files changed

Lines changed: 748 additions & 686 deletions

mintlify/openapi.yaml

Lines changed: 245 additions & 220 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi.yaml

Lines changed: 245 additions & 220 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
type: object
2+
properties:
3+
umaDomain:
4+
type: string
5+
example: mycompany.com
6+
webhookEndpoint:
7+
type: string
8+
example: https://api.mycompany.com/webhooks/uma
9+
supportedCurrencies:
10+
type: array
11+
items:
12+
$ref: ./PlatformCurrencyConfig.yaml
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
type: object
2+
required:
3+
- jobId
4+
- status
5+
properties:
6+
jobId:
7+
type: string
8+
description: Unique identifier for the bulk import job
9+
example: Job:019542f5-b3e7-1d02-0000-000000000006
10+
status:
11+
type: string
12+
enum:
13+
- PENDING
14+
- PROCESSING
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
type: object
2+
properties:
3+
kycUrl:
4+
type: string
5+
description: A hosted KYC link for your customer to complete KYC
6+
example: "https://example.com/redirect"
7+
platformCustomerId:
8+
type: string
9+
description: The platform id of the customer to onboard
10+
example: 019542f5-b3e7-1d02-0000-000000000001
11+
customerId:
12+
type: string
13+
description: The customer id of the newly created customer on the system
14+
example: Customer:019542f5-b3e7-1d02-0000-000000000001
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
type: object
2+
required:
3+
- inviteeUma
4+
properties:
5+
inviteeUma:
6+
type: string
7+
description: The UMA address of the customer claiming the invitation
8+
example: $invitee@uma.domain
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
type: object
2+
required:
3+
- inviterUma
4+
properties:
5+
inviterUma:
6+
type: string
7+
description: The UMA address of the customer creating the invitation
8+
example: $inviter@uma.domain
9+
firstName:
10+
type: string
11+
description: First name of the invitee to show as part of the invite
12+
example: Alice
13+
amountToSend:
14+
description: >
15+
An amount to send (in the smallest unit of the customer's currency)
16+
to the invitee when the invitation is claimed.
17+
18+
This is optional and if not provided, the invitee will not
19+
receive any amount. Note that the actual sending of
20+
21+
the amount must be done by the inviter platform once the
22+
INVITATION_CLAIMED webhook is received. If the inviter
23+
24+
platform either does not send the payment or the payment fails,
25+
the invitee will not receive this amount. This
26+
27+
field is primarily used for display purposes on the claiming
28+
side of the invitation.
29+
type: integer
30+
format: int64
31+
example: 12550
32+
expiresAt:
33+
type: string
34+
format: date-time
35+
description: When the invitation expires (if at all)
36+
example: '2025-09-01T14:30:00Z'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
type: object
2+
required:
3+
- amount
4+
properties:
5+
amount:
6+
type: integer
7+
format: int64
8+
description: >-
9+
Amount to add in the smallest unit of the account's currency (e.g.,
10+
cents for USD/EUR, satoshis for BTC)
11+
exclusiveMinimum: 0
12+
maximum: 100000000000
13+
example: 100000
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
type: object
2+
required:
3+
- quoteId
4+
- currencyCode
5+
properties:
6+
quoteId:
7+
type: string
8+
description: The unique identifier of the quote
9+
example: Quote:019542f5-b3e7-1d02-0000-000000000006
10+
currencyCode:
11+
type: string
12+
description: Currency code for the funds to be sent
13+
example: USD
14+
currencyAmount:
15+
type: integer
16+
format: int64
17+
description: >-
18+
The amount to send in the smallest unit of the currency (eg.
19+
cents). If not provided, the amount will be derived from the quote.
20+
exclusiveMinimum: 0
21+
example: 1000
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
type: object
2+
required:
3+
- senderUmaAddress
4+
- receivingCurrencyCode
5+
- receivingCurrencyAmount
6+
properties:
7+
senderUmaAddress:
8+
type: string
9+
description: UMA address of the sender from the sandbox
10+
example: $success.usd@sandbox.grid.uma.money
11+
receiverUmaAddress:
12+
type: string
13+
description: UMA address of the receiver (optional if customerId is provided)
14+
example: $receiver@uma.domain
15+
customerId:
16+
type: string
17+
description: >-
18+
System ID of the receiver (optional if receiverUmaAddress is
19+
provided)
20+
example: Customer:019542f5-b3e7-1d02-0000-000000000001
21+
receivingCurrencyCode:
22+
type: string
23+
description: The currency code for the receiving amount
24+
example: USD
25+
receivingCurrencyAmount:
26+
type: integer
27+
format: int64
28+
description: >-
29+
The amount to be received in the smallest unit of the currency
30+
(eg. cents)
31+
exclusiveMinimum: 0
32+
example: 1000

0 commit comments

Comments
 (0)