feat(internal-accounts): record the customer a platform rule-based account receives for - #1080
ls-bolt[bot] wants to merge 2 commits into
Conversation
…count receives for Co-Authored-By: bsiaotickchong <bsiaotickchong@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
|
@greptile review |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
| type: string | ||
| description: >- | ||
| The customer whose payments this platform-owned account receives. Null |
There was a problem hiding this comment.
Null response value is disallowed
For accounts that name no customer, including every customer-owned account, the description says this field is null. But type: string does not allow null in this OpenAPI 3.1 schema. A response containing the documented value will fail schema validation and may fail deserialization in generated clients. Declare the field as accepting both strings and null.
| type: string | |
| description: >- | |
| The customer whose payments this platform-owned account receives. Null | |
| type: [string, 'null'] | |
| description: >- | |
| The customer whose payments this platform-owned account receives. Null |
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/customers/InternalAccount.yaml
Line: 36-38
Comment:
**Null response value is disallowed**
For accounts that name no customer, including every customer-owned account, the description says this field is `null`. But `type: string` does not allow `null` in this OpenAPI 3.1 schema. A response containing the documented value will fail schema validation and may fail deserialization in generated clients. Declare the field as accepting both strings and null.
```suggestion
type: [string, 'null']
description: >-
The customer whose payments this platform-owned account receives. Null
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Right that the wording was wrong, but the value is never actually null: the server serializes with exclude_none, so an unset field is omitted. I fixed the description to say "Omitted" instead of widening the type (f119a55). The sibling label field follows the same convention, and the spec has no [string, 'null'] fields.
There was a problem hiding this comment.
That resolves the concern. An optional type: string property may be omitted, and the updated description now documents omission rather than null; with exclude_none serialization, the response matches the schema. The existing label convention further supports this approach, so no [string, 'null'] widening is needed.
…hen unset Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Summary
Adds
onBehalfOfCustomerIdto internal accounts. A platform-owned rule-based account can now name the customer whose payments it receives, while the platform keeps owning the account.InternalAccountCreateRequest.onBehalfOfCustomerId(optional): accepted only whencustomerIdis omitted. It must name a customer of the calling platform. The customer does not need to be verified. Several accounts can name the same customer.InternalAccount.onBehalfOfCustomerId: echoed on reads, and omitted for accounts that name no customer, including every customer-owned account.POST /internal-accounts:onBehalfOfCustomerrequest example400now covers sendingonBehalfOfCustomerIdtogether withcustomerId404now covers anonBehalfOfCustomerIdthat names no customer of the platformNon-breaking: an optional request field and an optional response field.
Implementation
The server side, and the regenerated client that depends on this spec, is in lightsparkdev/webdev#34152. Merge this PR first.
Test plan
make buildrebundlesopenapi.yamlandmintlify/openapi.yaml.make lint-openapi: 0 errors, the same asmain.