Skip to content

fix(cards): use anyOf for nullable Card.stateReason#526

Merged
AaryamanBhute merged 1 commit into
mainfrom
fix-card-statereason-oneof
May 28, 2026
Merged

fix(cards): use anyOf for nullable Card.stateReason#526
AaryamanBhute merged 1 commit into
mainfrom
fix-card-statereason-oneof

Conversation

@AaryamanBhute
Copy link
Copy Markdown
Contributor

The stateReason oneOf is a nullability wrapper (CardStateReason enum or
null), not a discriminated union, so it can't carry a discriminator.
Switch to anyOf, the standard OpenAPI 3.1 idiom for nullable refs.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

The stateReason oneOf is a nullability wrapper (CardStateReason enum or
null), not a discriminated union, so it can't carry a discriminator.
Switch to anyOf, the standard OpenAPI 3.1 idiom for nullable refs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
grid-flow-builder Ready Ready Preview, Comment May 28, 2026 7:45pm

Request Review

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions Bot added the breaking-change Introduces a breaking change to the OpenAPI spec label May 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Breaking OpenAPI changes detected

This PR introduces breaking changes to openapi.yaml:

API Changelog 2025-10-13 vs. 2025-10-13

API Changes

POST webhook:card-funding-source-change

  • ⚠️ removed #/components/schemas/CardStateReason, subschema #2 from the allOf[subschema #2]/data/stateReason request property oneOf list

POST webhook:card-state-change

  • ⚠️ removed #/components/schemas/CardStateReason, subschema #2 from the allOf[subschema #2]/data/stateReason request property oneOf list

Detected by oasdiff. This PR will need approval from an API reviewer before merge.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

✱ Stainless preview builds for grid

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

cli

chore(internal): regenerate SDK with no functional changes

csharp

chore(internal): regenerate SDK with no functional changes

go

chore(internal): regenerate SDK with no functional changes

kotlin

chore(internal): regenerate SDK with no functional changes

openapi

fix(types): change stateReason from oneOf to anyOf in Card model

php

chore(internal): regenerate SDK with no functional changes

python

chore(internal): regenerate SDK with no functional changes

ruby

chore(internal): regenerate SDK with no functional changes

typescript

chore(internal): regenerate SDK with no functional changes
⚠️ grid-openapi studio · code

Your SDK build had at least one warning diagnostic.
generate ✅

⚠️ grid-ruby studio · code

Your SDK build had at least one "warning" diagnostic.
generate ⚠️build ✅lint ✅test ✅

⚠️ grid-typescript studio · code

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ✅build ✅lint ❗test ✅

npm install https://pkg.stainless.com/s/grid-typescript/d2499b22753caa666eb5b797160b5da2604f9051/dist.tar.gz
⚠️ grid-kotlin studio · code

Your SDK build had a failure in the test CI job, which is a regression from the base state.
generate ✅build ✅lint ✅test ❗

⚠️ grid-python studio · code

Your SDK build had at least one warning diagnostic.
generate ✅build ✅lint ✅test ✅

pip install https://pkg.stainless.com/s/grid-python/05cdf0a9a9f26a86056254e96debf66524ed4cfc/grid-0.0.1-py3-none-any.whl
⚠️ grid-csharp studio · code

Your SDK build had a failure in the build CI job, which is a regression from the base state.
generate ⚠️build ❗lint ✅test ❗

⚠️ grid-go studio · code

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ✅build ✅lint ❗test ❗

go get github.com/stainless-sdks/grid-go@6018f36e8fc86ea786f16299c71fcabafb3f3779
⚠️ grid-php studio · code

Your SDK build had at least one warning diagnostic.
generate ✅lint ✅test ✅

⚠️ grid-cli studio · code

Your SDK build had a failure in the test CI job, which is a regression from the base state.
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-05-28 20:55:32 UTC

@AaryamanBhute AaryamanBhute marked this pull request as ready for review May 28, 2026 20:48
@AaryamanBhute AaryamanBhute merged commit c4fc62c into main May 28, 2026
10 checks passed
Copy link
Copy Markdown
Contributor Author

Merge activity

@AaryamanBhute AaryamanBhute deleted the fix-card-statereason-oneof branch May 28, 2026 20:49
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 28, 2026

Greptile Summary

Fixes the stateReason field on the Card schema by replacing oneOf with anyOf for the nullable-ref pattern. oneOf demands exactly one matching subschema and is intended for discriminated unions (which require a discriminator field); anyOf is the correct OpenAPI 3.1 idiom for "this value OR null."

  • The one-line fix is applied consistently across all three spec files: openapi/components/schemas/cards/Card.yaml (source of truth), openapi.yaml (bundled spec), and mintlify/openapi.yaml (docs copy).
  • No logic, field names, descriptions, or examples were changed — only the combiner keyword was corrected.

Confidence Score: 5/5

Minimal-risk, one-line schema fix applied consistently across all three spec files — safe to merge.

The change is a narrowly scoped correction to a single field combiner keyword across three files that are copies of each other. All three files are updated identically, no behavioral logic changes, and the fix aligns with standard OpenAPI 3.1 semantics for nullable references.

No files require special attention.

Important Files Changed

Filename Overview
openapi/components/schemas/cards/Card.yaml Source-of-truth schema: switches stateReason from oneOf to anyOf for correct nullable-ref semantics in OpenAPI 3.1.
openapi.yaml Bundled OpenAPI spec: applies the same oneOf → anyOf fix, kept in sync with the source schema.
mintlify/openapi.yaml Mintlify docs copy of the spec: applies the same oneOf → anyOf fix, consistent with the other two files.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Card.stateReason value] --> B{Is value null?}
    B -- Yes --> C["anyOf: type 'null' ✅ matches"]
    B -- No --> D["anyOf: $ref CardStateReason ✅ matches"]
    C --> E[Valid — field resolves to null]
    D --> F[Valid — field resolves to CardStateReason enum]

    style C fill:#c8f7c5
    style D fill:#c8f7c5
    style E fill:#c8f7c5
    style F fill:#c8f7c5
Loading

Reviews (1): Last reviewed commit: "fix(cards): use anyOf for nullable Card...." | Re-trigger Greptile

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

Labels

breaking-change Introduces a breaking change to the OpenAPI spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants