feat(customers): require businessInfo when creating a business customer - #717
Conversation
|
✱ Stainless preview builds for gridThis PR will update the cli go kotlin openapi php python ruby typescript ✅ grid-ruby studio · code
|
Greptile SummaryThis PR tightens the
Confidence Score: 4/5Safe to merge; the schema change is minimal, correct, and both generated bundles are in sync. One doc snippet carries a now-inaccurate claim about required fields for business customers. The schema change itself is correct and well-scoped. The only gap is that mintlify/snippets/creating-customers/customers.mdx still says 'The only required field for all customers is customerType', which contradicts the newly enforced businessInfo requirement for business customers and could mislead integrators. mintlify/snippets/creating-customers/customers.mdx — the customer-type requirements description needs updating.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/customers/BusinessCustomerCreateRequest.yaml | Adds required: [businessInfo] to the inline allOf member that already defined the businessInfo property; change is minimal and correctly placed. |
| openapi.yaml | Generated bundle that correctly reflects the source schema change — required field added to BusinessCustomerCreateRequest's inline allOf member. |
| mintlify/openapi.yaml | Mintlify-specific generated bundle; identical change to openapi.yaml, both are in sync. |
Sequence Diagram
%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Client
participant API as POST /customers
participant Validator as Schema Validator
Client->>API: "{customerType: "BUSINESS", ...}"
API->>Validator: validate against BusinessCustomerCreateRequest
alt businessInfo omitted (before this PR)
Validator-->>API: valid (businessInfo was optional)
API-->>Client: 200 OK
end
alt businessInfo omitted (after this PR)
Validator-->>API: invalid (businessInfo now required)
API-->>Client: 400 Bad Request
end
alt businessInfo provided
Validator-->>API: valid (legalName, taxId, incorporatedOn required within businessInfo)
API-->>Client: 200 OK
end
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Client
participant API as POST /customers
participant Validator as Schema Validator
Client->>API: "{customerType: "BUSINESS", ...}"
API->>Validator: validate against BusinessCustomerCreateRequest
alt businessInfo omitted (before this PR)
Validator-->>API: valid (businessInfo was optional)
API-->>Client: 200 OK
end
alt businessInfo omitted (after this PR)
Validator-->>API: invalid (businessInfo now required)
API-->>Client: 400 Bad Request
end
alt businessInfo provided
Validator-->>API: valid (legalName, taxId, incorporatedOn required within businessInfo)
API-->>Client: 200 OK
end
Reviews (1): Last reviewed commit: "feat(customers): require businessInfo wh..." | Re-trigger Greptile
Summary
Makes
businessInfoa required field when creating a business customer viaPOST /customers.Previously
businessInfowas optional onBusinessCustomerCreateRequest, even though the nested object already requireslegalName,taxId, andincorporatedOn. A business customer can't be meaningfully onboarded without it, so this tightens the schema to reject requests that omit it entirely.Changes
openapi/components/schemas/customers/BusinessCustomerCreateRequest.yaml— addbusinessInfoto therequiredlist on the business-specificallOfmember. This applies only to theBUSINESSbranch of the create request; individual customers are unaffected.openapi.yamlandmintlify/openapi.yamlviamake build.make lintpasses (only pre-existing, unrelatedschema-properties-*warnings remain).Note:
info.version/servers.urlare unchanged — the spec date-version tracks published API versions, and bumping it implies a new server path, which is a separate coordinated rollout.Requested by @shreyav
Original PR: #716