Skip to content

Fixed encoding of boolean query params#3104

Merged
jar-stripe merged 1 commit intomasterfrom
jar/fix-bool-param-encoding
Apr 17, 2025
Merged

Fixed encoding of boolean query params#3104
jar-stripe merged 1 commit intomasterfrom
jar/fix-bool-param-encoding

Conversation

@jar-stripe
Copy link
Copy Markdown
Contributor

Why?

The ContentEncoder class does not have a special case for encoding boolean query params, and .NET's bool ToString method outputs capitalized True or False. v1 apis would accept these or the lowercase versions true or false, but but v2 strictly requires the lowercase true or false. This PR updates ContentEncoder to correctly encode booleans for both API versions.

What?

  • changed ContentEncoder to emit lowercase true/false for boolean params
  • updated tests

See Also

@jar-stripe jar-stripe marked this pull request as ready for review April 17, 2025 20:02
@jar-stripe jar-stripe requested a review from a team as a code owner April 17, 2025 20:02
@jar-stripe jar-stripe requested review from helenye-stripe and removed request for a team April 17, 2025 20:02
@jar-stripe jar-stripe merged commit f7bf7b8 into master Apr 17, 2025
4 checks passed
@jar-stripe jar-stripe deleted the jar/fix-bool-param-encoding branch April 17, 2025 20:50
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.

2 participants