FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add discriminated union serialization tests by jar-stripe · Pull Request #2111 · stripe/stripe-php · GitHub

Add discriminated union serialization tests - #2111

Closed
jar-stripe wants to merge 1 commit into
masterfrom
jar/discriminated-unions
Closed

Add discriminated union serialization tests#2111
jar-stripe wants to merge 1 commit into
masterfrom
jar/discriminated-unions

Conversation

jar-stripe commented Jul 30, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Why?

Validates that the discriminated union serialization design works correctly in stripe-php before codegen produces these patterns. Covers both request-side (array params with literal discriminator) and response-side (StripeObject construction).

What?

  • Adds tests/Stripe/DiscriminatedUnionTest.php with 10 tests covering:
    • Standalone union: array params structure with discriminator key (request side)
    • Inline union: discriminator at parent level (request side)
    • Form encoding: verifies discriminator survives Util::encodeParameters
    • Response deserialization via Util::convertToStripeObject for both patterns

See Also

Tests discriminated union serialization for both request-side (array
params with literal discriminator) and response-side (StripeObject
construction), covering standalone and inline variants.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude

Copy link
Copy Markdown
Contributor Author

Collapsed into #2113 (coercion PR now includes serialization tests)

jar-stripe closed this Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL