Skip to content

Comments

fix: remove duplicate discriminators and move titles to fix Mintlify rendering#221

Open
pengying wants to merge 1 commit intomainfrom
fix/remove-duplicate-discriminators
Open

fix: remove duplicate discriminators and move titles to fix Mintlify rendering#221
pengying wants to merge 1 commit intomainfrom
fix/remove-duplicate-discriminators

Conversation

@pengying
Copy link
Contributor

Summary

  • Remove duplicate discriminator blocks from 11 base schemas — discriminators are already defined on the oneOf wrappers where they belong. Mintlify was multiplying type options because both the base schema and wrapper had discriminators.
  • Move title from $ref siblings into schema files — titles placed as $ref siblings in oneOf entries were being lost during Mintlify's schema resolution. Moved titles into 48 target schema files as top-level title: fields.
  • Replace 3 inline oneOf blocks in customers_{customerId}.yaml with $ref to CustomerOneOf.yaml to eliminate duplication.

Test plan

  • make build — bundles successfully
  • make lint — valid (20 pre-existing example warnings, 0 errors)
  • mint openapi-check — valid
  • Visually confirm in Mintlify that accountInfo on POST /customers/external-accounts no longer shows duplicate type entries

🤖 Generated with Claude Code

…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>
@github-actions
Copy link

github-actions bot commented Feb 21, 2026

✱ Stainless preview builds

This PR will update the grid SDKs with the following commit messages.

kotlin

fix(types): consolidate customers delete/retrieve/update response types to CustomerOneOf

openapi

chore(internal): reorganize discriminated union schemas with no functional changes

python

fix(types): unify return types to CustomerOneOf in customers retrieve/update/delete

typescript

fix(types): standardize customers retrieve/update/delete return types to CustomerOneOf

Edit this comment to update them. They will appear in their respective SDK's changelogs.

grid-openapi studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅

grid-python studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ✅test ✅

pip install https://pkg.stainless.com/s/grid-python/e85fbd3bd132cf8ca2f17a8a194f539031404a17/grid-0.0.1-py3-none-any.whl
grid-kotlin studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ✅test ✅

grid-typescript studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ✅test ✅

npm install https://pkg.stainless.com/s/grid-typescript/b1c1cb2172f386416743d0e0b0ce85f112fb2174/dist.tar.gz

This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-02-21 19:17:34 UTC

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 21, 2026

Greptile Summary

This PR fixes Mintlify rendering issues by eliminating duplicate discriminator blocks and relocating title fields from $ref siblings into their target schema files.

  • Removed duplicate discriminators from 11 base schemas (BasePaymentAccountInfo, BaseExternalAccountInfo, BaseBeneficiary, Customer, CustomerCreateRequest, CustomerUpdateRequest, BaseDestination, BaseQuoteSource, Transaction, BaseTransactionDestination, BaseTransactionSource). Each base schema had a discriminator identical to the one already defined on its corresponding *OneOf.yaml wrapper — Mintlify was multiplying type options because both locations declared discriminators.
  • Moved title fields from $ref siblings into 48 schema files across common/, customers/, external_accounts/, quotes/, and transactions/ domains. Titles placed as siblings to $ref in oneOf entries were being lost during Mintlify's schema resolution; moving them into the schema files as top-level title: fields ensures they persist after bundling.
  • Replaced 3 inline oneOf blocks in customers_{customerId}.yaml (GET, PATCH, DELETE responses) with a single $ref to CustomerOneOf.yaml, eliminating code duplication.
  • Bundled output files (openapi.yaml and mintlify/openapi.yaml) are regenerated and identical, confirming make build was run successfully.

Confidence Score: 5/5

  • This PR is safe to merge — it is a mechanical refactoring of OpenAPI schema metadata with no behavioral or API contract changes.
  • All changes are structural: moving titles into schema files, removing duplicate discriminator blocks, and replacing inline oneOf with $ref. The discriminator mappings on the OneOf wrappers (the canonical location) are unchanged. All 48 titles match their previous values exactly. The bundled outputs are regenerated and identical between openapi.yaml and mintlify/openapi.yaml. The PR description confirms make build, make lint, and mint openapi-check all pass.
  • No files require special attention. All changes are mechanical and consistent.

Important Files Changed

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
Loading

Last reviewed commit: 308f5ed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant