fix: remove duplicate discriminators and move titles to fix Mintlify rendering#221
fix: remove duplicate discriminators and move titles to fix Mintlify rendering#221
Conversation
…rendering
Mintlify was rendering duplicate type options for oneOf fields (e.g. accountInfo
on external-accounts) because discriminator blocks were defined on both base
schemas and oneOf wrappers. Additionally, titles placed as $ref siblings in
oneOf entries were being lost during schema resolution.
- Remove discriminator blocks from 11 base schemas (keep on oneOf wrappers)
- Move title from $ref siblings in 12 oneOf files into 48 target schema files
- Replace 3 inline oneOf blocks in customers_{customerId}.yaml with $ref
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✱ Stainless preview buildsThis PR will update the kotlin openapi python typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-openapi studio · code · diff
✅ grid-python studio · code · diff
✅ grid-kotlin studio · code · diff
✅ grid-typescript studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
Greptile SummaryThis PR fixes Mintlify rendering issues by eliminating duplicate
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| openapi/paths/customers/customers_{customerId}.yaml | Replaced 3 inline oneOf+discriminator blocks with $ref to CustomerOneOf.yaml, reducing duplication across GET/PATCH/DELETE responses. |
| openapi/components/schemas/common/BasePaymentAccountInfo.yaml | Removed duplicate discriminator block (12 mappings). The canonical discriminator remains in PaymentInstructions.yaml. |
| openapi/components/schemas/common/PaymentInstructions.yaml | Removed title fields from oneOf $ref siblings; titles now live in the referenced schema files. Discriminator kept intact. |
| openapi/components/schemas/external_accounts/BaseExternalAccountInfo.yaml | Removed duplicate discriminator block (16 mappings). Canonical discriminator remains in ExternalAccountInfoOneOf.yaml. |
| openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml | Removed title fields from 16 oneOf $ref siblings; titles now live in the referenced schema files. Discriminator kept intact. |
| openapi/components/schemas/external_accounts/BaseBeneficiary.yaml | Removed duplicate discriminator block (2 mappings). Canonical discriminator remains in BeneficiaryOneOf.yaml. |
| openapi/components/schemas/customers/Customer.yaml | Removed duplicate discriminator block. Canonical discriminator remains in CustomerOneOf.yaml. |
| openapi/components/schemas/transactions/Transaction.yaml | Removed duplicate discriminator block. Canonical discriminator remains in TransactionOneOf.yaml. |
| openapi/components/schemas/quotes/BaseDestination.yaml | Removed duplicate discriminator block. Canonical discriminator remains in QuoteDestinationOneOf.yaml. |
| openapi/components/schemas/quotes/BaseQuoteSource.yaml | Removed duplicate discriminator block. Canonical discriminator remains in QuoteSourceOneOf.yaml. |
| openapi.yaml | Regenerated bundle reflecting all source changes: titles moved into schemas, duplicate discriminators removed, inline oneOf replaced with $ref. |
| mintlify/openapi.yaml | Regenerated bundle identical to openapi.yaml, reflecting all source changes for Mintlify rendering. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph Before["Before: Duplicate Discriminators"]
B1["Base Schema\n(e.g. Customer.yaml)\n❌ discriminator block"]
B2["OneOf Wrapper\n(e.g. CustomerOneOf.yaml)\n✅ discriminator block\n+ title as $ref sibling"]
B1 -->|"allOf $ref"| B3["Concrete Schema\n(e.g. IndividualCustomer.yaml)\nNo title"]
B2 -->|"oneOf $ref"| B3
end
subgraph After["After: Single Source of Truth"]
A1["Base Schema\n(e.g. Customer.yaml)\nNo discriminator"]
A2["OneOf Wrapper\n(e.g. CustomerOneOf.yaml)\n✅ discriminator block\nNo inline title"]
A1 -->|"allOf $ref"| A3["Concrete Schema\n(e.g. IndividualCustomer.yaml)\n✅ title field"]
A2 -->|"oneOf $ref"| A3
end
Before --> After
Last reviewed commit: 308f5ed
Summary
titlefrom$refsiblings into schema files — titles placed as$refsiblings in oneOf entries were being lost during Mintlify's schema resolution. Moved titles into 48 target schema files as top-leveltitle:fields.customers_{customerId}.yamlwith$reftoCustomerOneOf.yamlto eliminate duplication.Test plan
make build— bundles successfullymake lint— valid (20 pre-existing example warnings, 0 errors)mint openapi-check— validaccountInfoonPOST /customers/external-accountsno longer shows duplicate type entries🤖 Generated with Claude Code