Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove RawRequestOptions#ApiMode #3052

Open
wants to merge 2 commits into
base: sdk-release/next-major
Choose a base branch
from

Conversation

jar-stripe
Copy link
Contributor

@jar-stripe jar-stripe commented Feb 5, 2025

Why?

When we shipped RawRequest functionality in the 9/30 release, most LiveApiRequestor calls were implemented to determine the API mode from the path. The exception to this was RawRequestAsync, which accepted ApiMode as an option. This is not a configurable option (it is either V1 or V2 depending on the API) and inspecting the path is a reliable way to determine ApiMode; specifying the wrong ApiMode means that responses may be interpreted incorrectly. Because of this, we are removing this option to avoid confusion and the potential for subtle errors.

What?

  • removed RawRequestOptions@ApiMode argument
  • changed LiveApiRequestor#RawRequestAsync to use GetApiMode to determine apiMode
  • updated tests

Changelog

  • Removes ApiMode from RawRequestOptions. ApiMode is automatically determined from the path passed to RawRequest.

replaced ApiMode reference in LiveApiRequestor#RawRequestAsync with a call to GetApiMode
updated tests to remove ApiMode option (to ensure GetApiMode works)
@ramya-stripe ramya-stripe changed the title Marked RawRequestOptions#ApiMode as Obsolete Remove RawRequestOptions#ApiMode Feb 6, 2025
@@ -1,12 +1,10 @@
namespace Stripe
{
using System;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no net new code in this file... why this new import?

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