Skip to content

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

Merged
pengying merged 1 commit intomainfrom
fix/remove-duplicate-discriminators
Feb 25, 2026
Merged

fix: remove duplicate discriminators and move titles to fix Mintlify rendering#221
pengying merged 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

@github-actions
Copy link
Contributor

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
⚠️ grid-openapi studio · code

Your SDK build had at least one "error" diagnostic.
generate ❗

⚠️ grid-python studio · code

Your SDK build had at least one "error" diagnostic.
generate ❗build ✅lint ❗test ❗

pip install https://pkg.stainless.com/s/grid-python/22f1f19cef1e60741b3184ec78af3fd7521ba2aa/grid-0.0.1-py3-none-any.whl
⚠️ grid-kotlin studio · code

Your SDK build had at least one "error" diagnostic.
generate ❗build ✅lint ✅test ✅

⚠️ grid-typescript studio · code

Your SDK build had at least one "error" diagnostic.
generate ❗build ❗lint ❗test ❗


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-25 01:36:48 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

…rendering

Mintlify renders duplicate type options for oneOf fields when discriminator
blocks exist on both base schemas and oneOf wrappers. Titles placed as $ref
siblings in oneOf entries are also ignored per the OpenAPI spec.

- Remove discriminator blocks from 11 base schemas (keep on oneOf wrappers)
- Move titles from $ref siblings in oneOf files into target schema files
- Replace inline oneOf blocks in customers_{customerId}.yaml with $ref
- Fix title/$ref sibling issues in PaymentInstructions and beneficiary schemas

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pengying pengying force-pushed the fix/remove-duplicate-discriminators branch from 308f5ed to 393a055 Compare February 25, 2026 00:07
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 25, 2026

Too many files changed for review. (102 files found, 100 file limit)

@pengying pengying enabled auto-merge (squash) February 25, 2026 01:22
@pengying pengying merged commit 904efcf into main Feb 25, 2026
6 of 7 checks passed
@pengying pengying deleted the fix/remove-duplicate-discriminators branch February 25, 2026 01:29
AaryamanBhute added a commit that referenced this pull request Feb 25, 2026
Remove redundant title attributes from $ref siblings in
CadExternalAccountInfo, NgnExternalAccountInfo, and
ExternalAccountInfoOneOf. Titles live in the schema files
themselves per the pattern established in PR #221.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AaryamanBhute added a commit that referenced this pull request Feb 25, 2026
Remove redundant title attributes from $ref siblings in
CadExternalAccountInfo, NgnExternalAccountInfo, and
ExternalAccountInfoOneOf. Titles live in the schema files
themselves per the pattern established in PR #221.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@greptile-apps greptile-apps bot mentioned this pull request Feb 25, 2026
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.

3 participants