From c48c11d7ded34e0caebe970203291c68ba9552fb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 04:00:30 +0000 Subject: [PATCH 01/41] chore: format all `api.md` files --- scripts/format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/format b/scripts/format index 1d2f9c6..c8e1f69 100755 --- a/scripts/format +++ b/scripts/format @@ -11,4 +11,4 @@ uv run ruff check --fix . uv run ruff format echo "==> Formatting docs" -uv run python scripts/utils/ruffen-docs.py README.md api.md +uv run python scripts/utils/ruffen-docs.py README.md $(find . -type f -name api.md) From aed61b71afd19864976d3202e6d2b48cadae2ee8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 20:02:14 +0000 Subject: [PATCH 02/41] fix: use correct format for nested and array query params --- .stats.yml | 2 +- src/stainless_commons_stripe/_client.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index f62eaaf..549ae0a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 22 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless-commons%2Fstripe-minimal-d7db5d2f2f83e89d00e8529a1b6d4ed4746bd306d0e6ffba02f321b576dcc340.yml openapi_spec_hash: e09fbe83a958ffba517bce207e9f9dc1 -config_hash: 957cd4dc5cc7bbb0ca9a15611bb95cdc +config_hash: 4435a4ca740728c29979cd8f628c10df diff --git a/src/stainless_commons_stripe/_client.py b/src/stainless_commons_stripe/_client.py index a96dd23..3339fe5 100644 --- a/src/stainless_commons_stripe/_client.py +++ b/src/stainless_commons_stripe/_client.py @@ -204,7 +204,7 @@ def with_streaming_response(self) -> StripeWithStreamedResponse: @property @override def qs(self) -> Querystring: - return Querystring(array_format="comma") + return Querystring(array_format="brackets") @property @override @@ -457,7 +457,7 @@ def with_streaming_response(self) -> AsyncStripeWithStreamedResponse: @property @override def qs(self) -> Querystring: - return Querystring(array_format="comma") + return Querystring(array_format="brackets") @property @override From 81c84023ed762036e97a88e85684cc5fa25d1adf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 20:22:06 +0000 Subject: [PATCH 03/41] chore(test): enable generated tests --- .stats.yml | 2 +- scripts/mock | 12 ++++----- scripts/test | 16 ++++++------ tests/api_resources/test_accounts.py | 8 ------ tests/api_resources/test_balance.py | 8 ------ tests/api_resources/test_coupons.py | 16 ------------ tests/api_resources/test_customers.py | 16 ------------ tests/api_resources/test_disputes.py | 18 ------------- tests/api_resources/test_invoiceitems.py | 8 ------ tests/api_resources/test_invoices.py | 26 ------------------- tests/api_resources/test_payment_intents.py | 8 ------ tests/api_resources/test_payment_links.py | 8 ------ tests/api_resources/test_prices.py | 16 ------------ tests/api_resources/test_products.py | 16 ------------ tests/api_resources/test_refunds.py | 8 ------ tests/api_resources/test_subscriptions.py | 28 --------------------- 16 files changed, 15 insertions(+), 199 deletions(-) diff --git a/.stats.yml b/.stats.yml index 549ae0a..69ddc11 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 22 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless-commons%2Fstripe-minimal-d7db5d2f2f83e89d00e8529a1b6d4ed4746bd306d0e6ffba02f321b576dcc340.yml openapi_spec_hash: e09fbe83a958ffba517bce207e9f9dc1 -config_hash: 4435a4ca740728c29979cd8f628c10df +config_hash: 59158dbcf8534e76accb613919408cdb diff --git a/scripts/mock b/scripts/mock index 0b28f6e..f434edf 100755 --- a/scripts/mock +++ b/scripts/mock @@ -19,23 +19,23 @@ fi echo "==> Starting mock server with URL ${URL}" -# Run prism mock on the given spec +# Run steady mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stdy/cli@0.15.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online echo -n "Waiting for server" - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + while ! grep -q "ERROR\|Steady server listening on" ".stdy.log" ; do echo -n "." sleep 0.1 done - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log + if grep -q "ERROR" ".stdy.log"; then + cat .stdy.log exit 1 fi echo else - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" + npm exec --package=@stdy/cli@0.15.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index b56970b..f53175d 100755 --- a/scripts/test +++ b/scripts/test @@ -9,8 +9,8 @@ GREEN='\033[0;32m' YELLOW='\033[0;33m' NC='\033[0m' # No Color -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 +function steady_is_running() { + curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1 } kill_server_on_port() { @@ -25,7 +25,7 @@ function is_overriding_api_base_url() { [ -n "$TEST_API_BASE_URL" ] } -if ! is_overriding_api_base_url && ! prism_is_running ; then +if ! is_overriding_api_base_url && ! steady_is_running ; then # When we exit this script, make sure to kill the background mock server process trap 'kill_server_on_port 4010' EXIT @@ -36,19 +36,19 @@ fi if is_overriding_api_base_url ; then echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" +elif ! steady_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server" echo -e "running against your OpenAPI spec." echo echo -e "To run the server, pass in the path or url of your OpenAPI" - echo -e "spec to the prism command:" + echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.15.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}" echo fi diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index 076df33..372f6aa 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -17,13 +17,11 @@ class TestAccounts: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Stripe) -> None: account = client.accounts.retrieve() assert_matches_type(Account, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Stripe) -> None: account = client.accounts.retrieve( @@ -31,7 +29,6 @@ def test_method_retrieve_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(Account, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Stripe) -> None: response = client.accounts.with_raw_response.retrieve() @@ -41,7 +38,6 @@ def test_raw_response_retrieve(self, client: Stripe) -> None: account = response.parse() assert_matches_type(Account, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Stripe) -> None: with client.accounts.with_streaming_response.retrieve() as response: @@ -59,13 +55,11 @@ class TestAsyncAccounts: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncStripe) -> None: account = await async_client.accounts.retrieve() assert_matches_type(Account, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncStripe) -> None: account = await async_client.accounts.retrieve( @@ -73,7 +67,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncStripe) ) assert_matches_type(Account, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncStripe) -> None: response = await async_client.accounts.with_raw_response.retrieve() @@ -83,7 +76,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncStripe) -> None: account = await response.parse() assert_matches_type(Account, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncStripe) -> None: async with async_client.accounts.with_streaming_response.retrieve() as response: diff --git a/tests/api_resources/test_balance.py b/tests/api_resources/test_balance.py index 475b802..bd44e9a 100644 --- a/tests/api_resources/test_balance.py +++ b/tests/api_resources/test_balance.py @@ -17,13 +17,11 @@ class TestBalance: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Stripe) -> None: balance = client.balance.retrieve() assert_matches_type(BalanceRetrieveResponse, balance, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Stripe) -> None: balance = client.balance.retrieve( @@ -31,7 +29,6 @@ def test_method_retrieve_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(BalanceRetrieveResponse, balance, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Stripe) -> None: response = client.balance.with_raw_response.retrieve() @@ -41,7 +38,6 @@ def test_raw_response_retrieve(self, client: Stripe) -> None: balance = response.parse() assert_matches_type(BalanceRetrieveResponse, balance, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Stripe) -> None: with client.balance.with_streaming_response.retrieve() as response: @@ -59,13 +55,11 @@ class TestAsyncBalance: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncStripe) -> None: balance = await async_client.balance.retrieve() assert_matches_type(BalanceRetrieveResponse, balance, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncStripe) -> None: balance = await async_client.balance.retrieve( @@ -73,7 +67,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncStripe) ) assert_matches_type(BalanceRetrieveResponse, balance, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncStripe) -> None: response = await async_client.balance.with_raw_response.retrieve() @@ -83,7 +76,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncStripe) -> None: balance = await response.parse() assert_matches_type(BalanceRetrieveResponse, balance, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncStripe) -> None: async with async_client.balance.with_streaming_response.retrieve() as response: diff --git a/tests/api_resources/test_coupons.py b/tests/api_resources/test_coupons.py index acc9850..7d818da 100644 --- a/tests/api_resources/test_coupons.py +++ b/tests/api_resources/test_coupons.py @@ -18,13 +18,11 @@ class TestCoupons: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Stripe) -> None: coupon = client.coupons.create() assert_matches_type(Coupon, coupon, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Stripe) -> None: coupon = client.coupons.create( @@ -44,7 +42,6 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(Coupon, coupon, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Stripe) -> None: response = client.coupons.with_raw_response.create() @@ -54,7 +51,6 @@ def test_raw_response_create(self, client: Stripe) -> None: coupon = response.parse() assert_matches_type(Coupon, coupon, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Stripe) -> None: with client.coupons.with_streaming_response.create() as response: @@ -66,13 +62,11 @@ def test_streaming_response_create(self, client: Stripe) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Stripe) -> None: coupon = client.coupons.list() assert_matches_type(SyncMyCursorIDPage[Coupon], coupon, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Stripe) -> None: coupon = client.coupons.list( @@ -89,7 +83,6 @@ def test_method_list_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(SyncMyCursorIDPage[Coupon], coupon, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Stripe) -> None: response = client.coupons.with_raw_response.list() @@ -99,7 +92,6 @@ def test_raw_response_list(self, client: Stripe) -> None: coupon = response.parse() assert_matches_type(SyncMyCursorIDPage[Coupon], coupon, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Stripe) -> None: with client.coupons.with_streaming_response.list() as response: @@ -117,13 +109,11 @@ class TestAsyncCoupons: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncStripe) -> None: coupon = await async_client.coupons.create() assert_matches_type(Coupon, coupon, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> None: coupon = await async_client.coupons.create( @@ -143,7 +133,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> ) assert_matches_type(Coupon, coupon, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncStripe) -> None: response = await async_client.coupons.with_raw_response.create() @@ -153,7 +142,6 @@ async def test_raw_response_create(self, async_client: AsyncStripe) -> None: coupon = await response.parse() assert_matches_type(Coupon, coupon, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncStripe) -> None: async with async_client.coupons.with_streaming_response.create() as response: @@ -165,13 +153,11 @@ async def test_streaming_response_create(self, async_client: AsyncStripe) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncStripe) -> None: coupon = await async_client.coupons.list() assert_matches_type(AsyncMyCursorIDPage[Coupon], coupon, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> None: coupon = await async_client.coupons.list( @@ -188,7 +174,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> N ) assert_matches_type(AsyncMyCursorIDPage[Coupon], coupon, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncStripe) -> None: response = await async_client.coupons.with_raw_response.list() @@ -198,7 +183,6 @@ async def test_raw_response_list(self, async_client: AsyncStripe) -> None: coupon = await response.parse() assert_matches_type(AsyncMyCursorIDPage[Coupon], coupon, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncStripe) -> None: async with async_client.coupons.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_customers.py b/tests/api_resources/test_customers.py index 6270b4c..9853a47 100644 --- a/tests/api_resources/test_customers.py +++ b/tests/api_resources/test_customers.py @@ -18,13 +18,11 @@ class TestCustomers: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Stripe) -> None: customer = client.customers.create() assert_matches_type(Customer, customer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Stripe) -> None: customer = client.customers.create( @@ -92,7 +90,6 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(Customer, customer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Stripe) -> None: response = client.customers.with_raw_response.create() @@ -102,7 +99,6 @@ def test_raw_response_create(self, client: Stripe) -> None: customer = response.parse() assert_matches_type(Customer, customer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Stripe) -> None: with client.customers.with_streaming_response.create() as response: @@ -114,13 +110,11 @@ def test_streaming_response_create(self, client: Stripe) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Stripe) -> None: customer = client.customers.list() assert_matches_type(SyncMyCursorIDPage[Customer], customer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Stripe) -> None: customer = client.customers.list( @@ -139,7 +133,6 @@ def test_method_list_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(SyncMyCursorIDPage[Customer], customer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Stripe) -> None: response = client.customers.with_raw_response.list() @@ -149,7 +142,6 @@ def test_raw_response_list(self, client: Stripe) -> None: customer = response.parse() assert_matches_type(SyncMyCursorIDPage[Customer], customer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Stripe) -> None: with client.customers.with_streaming_response.list() as response: @@ -167,13 +159,11 @@ class TestAsyncCustomers: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncStripe) -> None: customer = await async_client.customers.create() assert_matches_type(Customer, customer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> None: customer = await async_client.customers.create( @@ -241,7 +231,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> ) assert_matches_type(Customer, customer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncStripe) -> None: response = await async_client.customers.with_raw_response.create() @@ -251,7 +240,6 @@ async def test_raw_response_create(self, async_client: AsyncStripe) -> None: customer = await response.parse() assert_matches_type(Customer, customer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncStripe) -> None: async with async_client.customers.with_streaming_response.create() as response: @@ -263,13 +251,11 @@ async def test_streaming_response_create(self, async_client: AsyncStripe) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncStripe) -> None: customer = await async_client.customers.list() assert_matches_type(AsyncMyCursorIDPage[Customer], customer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> None: customer = await async_client.customers.list( @@ -288,7 +274,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> N ) assert_matches_type(AsyncMyCursorIDPage[Customer], customer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncStripe) -> None: response = await async_client.customers.with_raw_response.list() @@ -298,7 +283,6 @@ async def test_raw_response_list(self, async_client: AsyncStripe) -> None: customer = await response.parse() assert_matches_type(AsyncMyCursorIDPage[Customer], customer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncStripe) -> None: async with async_client.customers.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_disputes.py b/tests/api_resources/test_disputes.py index 4613419..720d8dc 100644 --- a/tests/api_resources/test_disputes.py +++ b/tests/api_resources/test_disputes.py @@ -18,7 +18,6 @@ class TestDisputes: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Stripe) -> None: dispute = client.disputes.update( @@ -26,7 +25,6 @@ def test_method_update(self, client: Stripe) -> None: ) assert_matches_type(Dispute, dispute, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Stripe) -> None: dispute = client.disputes.update( @@ -107,7 +105,6 @@ def test_method_update_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(Dispute, dispute, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Stripe) -> None: response = client.disputes.with_raw_response.update( @@ -119,7 +116,6 @@ def test_raw_response_update(self, client: Stripe) -> None: dispute = response.parse() assert_matches_type(Dispute, dispute, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Stripe) -> None: with client.disputes.with_streaming_response.update( @@ -133,7 +129,6 @@ def test_streaming_response_update(self, client: Stripe) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_update(self, client: Stripe) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispute` but received ''"): @@ -141,13 +136,11 @@ def test_path_params_update(self, client: Stripe) -> None: dispute="", ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Stripe) -> None: dispute = client.disputes.list() assert_matches_type(SyncMyCursorIDPage[Dispute], dispute, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Stripe) -> None: dispute = client.disputes.list( @@ -166,7 +159,6 @@ def test_method_list_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(SyncMyCursorIDPage[Dispute], dispute, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Stripe) -> None: response = client.disputes.with_raw_response.list() @@ -176,7 +168,6 @@ def test_raw_response_list(self, client: Stripe) -> None: dispute = response.parse() assert_matches_type(SyncMyCursorIDPage[Dispute], dispute, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Stripe) -> None: with client.disputes.with_streaming_response.list() as response: @@ -194,7 +185,6 @@ class TestAsyncDisputes: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncStripe) -> None: dispute = await async_client.disputes.update( @@ -202,7 +192,6 @@ async def test_method_update(self, async_client: AsyncStripe) -> None: ) assert_matches_type(Dispute, dispute, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncStripe) -> None: dispute = await async_client.disputes.update( @@ -283,7 +272,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncStripe) -> ) assert_matches_type(Dispute, dispute, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncStripe) -> None: response = await async_client.disputes.with_raw_response.update( @@ -295,7 +283,6 @@ async def test_raw_response_update(self, async_client: AsyncStripe) -> None: dispute = await response.parse() assert_matches_type(Dispute, dispute, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncStripe) -> None: async with async_client.disputes.with_streaming_response.update( @@ -309,7 +296,6 @@ async def test_streaming_response_update(self, async_client: AsyncStripe) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncStripe) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispute` but received ''"): @@ -317,13 +303,11 @@ async def test_path_params_update(self, async_client: AsyncStripe) -> None: dispute="", ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncStripe) -> None: dispute = await async_client.disputes.list() assert_matches_type(AsyncMyCursorIDPage[Dispute], dispute, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> None: dispute = await async_client.disputes.list( @@ -342,7 +326,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> N ) assert_matches_type(AsyncMyCursorIDPage[Dispute], dispute, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncStripe) -> None: response = await async_client.disputes.with_raw_response.list() @@ -352,7 +335,6 @@ async def test_raw_response_list(self, async_client: AsyncStripe) -> None: dispute = await response.parse() assert_matches_type(AsyncMyCursorIDPage[Dispute], dispute, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncStripe) -> None: async with async_client.disputes.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_invoiceitems.py b/tests/api_resources/test_invoiceitems.py index 0a63487..90f1938 100644 --- a/tests/api_resources/test_invoiceitems.py +++ b/tests/api_resources/test_invoiceitems.py @@ -17,13 +17,11 @@ class TestInvoiceitems: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Stripe) -> None: invoiceitem = client.invoiceitems.create() assert_matches_type(InvoiceitemCreateResponse, invoiceitem, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Stripe) -> None: invoiceitem = client.invoiceitems.create( @@ -64,7 +62,6 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(InvoiceitemCreateResponse, invoiceitem, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Stripe) -> None: response = client.invoiceitems.with_raw_response.create() @@ -74,7 +71,6 @@ def test_raw_response_create(self, client: Stripe) -> None: invoiceitem = response.parse() assert_matches_type(InvoiceitemCreateResponse, invoiceitem, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Stripe) -> None: with client.invoiceitems.with_streaming_response.create() as response: @@ -92,13 +88,11 @@ class TestAsyncInvoiceitems: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncStripe) -> None: invoiceitem = await async_client.invoiceitems.create() assert_matches_type(InvoiceitemCreateResponse, invoiceitem, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> None: invoiceitem = await async_client.invoiceitems.create( @@ -139,7 +133,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> ) assert_matches_type(InvoiceitemCreateResponse, invoiceitem, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncStripe) -> None: response = await async_client.invoiceitems.with_raw_response.create() @@ -149,7 +142,6 @@ async def test_raw_response_create(self, async_client: AsyncStripe) -> None: invoiceitem = await response.parse() assert_matches_type(InvoiceitemCreateResponse, invoiceitem, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncStripe) -> None: async with async_client.invoiceitems.with_streaming_response.create() as response: diff --git a/tests/api_resources/test_invoices.py b/tests/api_resources/test_invoices.py index 2053851..6469f5d 100644 --- a/tests/api_resources/test_invoices.py +++ b/tests/api_resources/test_invoices.py @@ -18,13 +18,11 @@ class TestInvoices: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Stripe) -> None: invoice = client.invoices.create() assert_matches_type(Invoice, invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Stripe) -> None: invoice = client.invoices.create( @@ -179,7 +177,6 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(Invoice, invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Stripe) -> None: response = client.invoices.with_raw_response.create() @@ -189,7 +186,6 @@ def test_raw_response_create(self, client: Stripe) -> None: invoice = response.parse() assert_matches_type(Invoice, invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Stripe) -> None: with client.invoices.with_streaming_response.create() as response: @@ -201,13 +197,11 @@ def test_streaming_response_create(self, client: Stripe) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Stripe) -> None: invoice = client.invoices.list() assert_matches_type(SyncMyCursorIDPage[Invoice], invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Stripe) -> None: invoice = client.invoices.list( @@ -235,7 +229,6 @@ def test_method_list_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(SyncMyCursorIDPage[Invoice], invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Stripe) -> None: response = client.invoices.with_raw_response.list() @@ -245,7 +238,6 @@ def test_raw_response_list(self, client: Stripe) -> None: invoice = response.parse() assert_matches_type(SyncMyCursorIDPage[Invoice], invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Stripe) -> None: with client.invoices.with_streaming_response.list() as response: @@ -257,7 +249,6 @@ def test_streaming_response_list(self, client: Stripe) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_finalize(self, client: Stripe) -> None: invoice = client.invoices.finalize( @@ -265,7 +256,6 @@ def test_method_finalize(self, client: Stripe) -> None: ) assert_matches_type(Invoice, invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_finalize_with_all_params(self, client: Stripe) -> None: invoice = client.invoices.finalize( @@ -275,7 +265,6 @@ def test_method_finalize_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(Invoice, invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_finalize(self, client: Stripe) -> None: response = client.invoices.with_raw_response.finalize( @@ -287,7 +276,6 @@ def test_raw_response_finalize(self, client: Stripe) -> None: invoice = response.parse() assert_matches_type(Invoice, invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_finalize(self, client: Stripe) -> None: with client.invoices.with_streaming_response.finalize( @@ -301,7 +289,6 @@ def test_streaming_response_finalize(self, client: Stripe) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_finalize(self, client: Stripe) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `invoice` but received ''"): @@ -315,13 +302,11 @@ class TestAsyncInvoices: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncStripe) -> None: invoice = await async_client.invoices.create() assert_matches_type(Invoice, invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> None: invoice = await async_client.invoices.create( @@ -476,7 +461,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> ) assert_matches_type(Invoice, invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncStripe) -> None: response = await async_client.invoices.with_raw_response.create() @@ -486,7 +470,6 @@ async def test_raw_response_create(self, async_client: AsyncStripe) -> None: invoice = await response.parse() assert_matches_type(Invoice, invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncStripe) -> None: async with async_client.invoices.with_streaming_response.create() as response: @@ -498,13 +481,11 @@ async def test_streaming_response_create(self, async_client: AsyncStripe) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncStripe) -> None: invoice = await async_client.invoices.list() assert_matches_type(AsyncMyCursorIDPage[Invoice], invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> None: invoice = await async_client.invoices.list( @@ -532,7 +513,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> N ) assert_matches_type(AsyncMyCursorIDPage[Invoice], invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncStripe) -> None: response = await async_client.invoices.with_raw_response.list() @@ -542,7 +522,6 @@ async def test_raw_response_list(self, async_client: AsyncStripe) -> None: invoice = await response.parse() assert_matches_type(AsyncMyCursorIDPage[Invoice], invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncStripe) -> None: async with async_client.invoices.with_streaming_response.list() as response: @@ -554,7 +533,6 @@ async def test_streaming_response_list(self, async_client: AsyncStripe) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_finalize(self, async_client: AsyncStripe) -> None: invoice = await async_client.invoices.finalize( @@ -562,7 +540,6 @@ async def test_method_finalize(self, async_client: AsyncStripe) -> None: ) assert_matches_type(Invoice, invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_finalize_with_all_params(self, async_client: AsyncStripe) -> None: invoice = await async_client.invoices.finalize( @@ -572,7 +549,6 @@ async def test_method_finalize_with_all_params(self, async_client: AsyncStripe) ) assert_matches_type(Invoice, invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_finalize(self, async_client: AsyncStripe) -> None: response = await async_client.invoices.with_raw_response.finalize( @@ -584,7 +560,6 @@ async def test_raw_response_finalize(self, async_client: AsyncStripe) -> None: invoice = await response.parse() assert_matches_type(Invoice, invoice, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_finalize(self, async_client: AsyncStripe) -> None: async with async_client.invoices.with_streaming_response.finalize( @@ -598,7 +573,6 @@ async def test_streaming_response_finalize(self, async_client: AsyncStripe) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_finalize(self, async_client: AsyncStripe) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `invoice` but received ''"): diff --git a/tests/api_resources/test_payment_intents.py b/tests/api_resources/test_payment_intents.py index d9aece2..12a4c56 100644 --- a/tests/api_resources/test_payment_intents.py +++ b/tests/api_resources/test_payment_intents.py @@ -18,13 +18,11 @@ class TestPaymentIntents: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Stripe) -> None: payment_intent = client.payment_intents.list() assert_matches_type(SyncMyCursorIDPage[PaymentIntent], payment_intent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Stripe) -> None: payment_intent = client.payment_intents.list( @@ -43,7 +41,6 @@ def test_method_list_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(SyncMyCursorIDPage[PaymentIntent], payment_intent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Stripe) -> None: response = client.payment_intents.with_raw_response.list() @@ -53,7 +50,6 @@ def test_raw_response_list(self, client: Stripe) -> None: payment_intent = response.parse() assert_matches_type(SyncMyCursorIDPage[PaymentIntent], payment_intent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Stripe) -> None: with client.payment_intents.with_streaming_response.list() as response: @@ -71,13 +67,11 @@ class TestAsyncPaymentIntents: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncStripe) -> None: payment_intent = await async_client.payment_intents.list() assert_matches_type(AsyncMyCursorIDPage[PaymentIntent], payment_intent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> None: payment_intent = await async_client.payment_intents.list( @@ -96,7 +90,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> N ) assert_matches_type(AsyncMyCursorIDPage[PaymentIntent], payment_intent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncStripe) -> None: response = await async_client.payment_intents.with_raw_response.list() @@ -106,7 +99,6 @@ async def test_raw_response_list(self, async_client: AsyncStripe) -> None: payment_intent = await response.parse() assert_matches_type(AsyncMyCursorIDPage[PaymentIntent], payment_intent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncStripe) -> None: async with async_client.payment_intents.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_payment_links.py b/tests/api_resources/test_payment_links.py index 05eadea..23811e5 100644 --- a/tests/api_resources/test_payment_links.py +++ b/tests/api_resources/test_payment_links.py @@ -17,7 +17,6 @@ class TestPaymentLinks: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Stripe) -> None: payment_link = client.payment_links.create( @@ -25,7 +24,6 @@ def test_method_create(self, client: Stripe) -> None: ) assert_matches_type(PaymentLinkCreateResponse, payment_link, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Stripe) -> None: payment_link = client.payment_links.create( @@ -205,7 +203,6 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(PaymentLinkCreateResponse, payment_link, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Stripe) -> None: response = client.payment_links.with_raw_response.create( @@ -217,7 +214,6 @@ def test_raw_response_create(self, client: Stripe) -> None: payment_link = response.parse() assert_matches_type(PaymentLinkCreateResponse, payment_link, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Stripe) -> None: with client.payment_links.with_streaming_response.create( @@ -237,7 +233,6 @@ class TestAsyncPaymentLinks: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncStripe) -> None: payment_link = await async_client.payment_links.create( @@ -245,7 +240,6 @@ async def test_method_create(self, async_client: AsyncStripe) -> None: ) assert_matches_type(PaymentLinkCreateResponse, payment_link, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> None: payment_link = await async_client.payment_links.create( @@ -425,7 +419,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> ) assert_matches_type(PaymentLinkCreateResponse, payment_link, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncStripe) -> None: response = await async_client.payment_links.with_raw_response.create( @@ -437,7 +430,6 @@ async def test_raw_response_create(self, async_client: AsyncStripe) -> None: payment_link = await response.parse() assert_matches_type(PaymentLinkCreateResponse, payment_link, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncStripe) -> None: async with async_client.payment_links.with_streaming_response.create( diff --git a/tests/api_resources/test_prices.py b/tests/api_resources/test_prices.py index 8e01096..e3d68e0 100644 --- a/tests/api_resources/test_prices.py +++ b/tests/api_resources/test_prices.py @@ -18,7 +18,6 @@ class TestPrices: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Stripe) -> None: price = client.prices.create( @@ -26,7 +25,6 @@ def test_method_create(self, client: Stripe) -> None: ) assert_matches_type(Price, price, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Stripe) -> None: price = client.prices.create( @@ -102,7 +100,6 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(Price, price, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Stripe) -> None: response = client.prices.with_raw_response.create( @@ -114,7 +111,6 @@ def test_raw_response_create(self, client: Stripe) -> None: price = response.parse() assert_matches_type(Price, price, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Stripe) -> None: with client.prices.with_streaming_response.create( @@ -128,13 +124,11 @@ def test_streaming_response_create(self, client: Stripe) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Stripe) -> None: price = client.prices.list() assert_matches_type(SyncMyCursorIDPage[Price], price, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Stripe) -> None: price = client.prices.list( @@ -161,7 +155,6 @@ def test_method_list_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(SyncMyCursorIDPage[Price], price, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Stripe) -> None: response = client.prices.with_raw_response.list() @@ -171,7 +164,6 @@ def test_raw_response_list(self, client: Stripe) -> None: price = response.parse() assert_matches_type(SyncMyCursorIDPage[Price], price, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Stripe) -> None: with client.prices.with_streaming_response.list() as response: @@ -189,7 +181,6 @@ class TestAsyncPrices: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncStripe) -> None: price = await async_client.prices.create( @@ -197,7 +188,6 @@ async def test_method_create(self, async_client: AsyncStripe) -> None: ) assert_matches_type(Price, price, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> None: price = await async_client.prices.create( @@ -273,7 +263,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> ) assert_matches_type(Price, price, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncStripe) -> None: response = await async_client.prices.with_raw_response.create( @@ -285,7 +274,6 @@ async def test_raw_response_create(self, async_client: AsyncStripe) -> None: price = await response.parse() assert_matches_type(Price, price, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncStripe) -> None: async with async_client.prices.with_streaming_response.create( @@ -299,13 +287,11 @@ async def test_streaming_response_create(self, async_client: AsyncStripe) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncStripe) -> None: price = await async_client.prices.list() assert_matches_type(AsyncMyCursorIDPage[Price], price, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> None: price = await async_client.prices.list( @@ -332,7 +318,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> N ) assert_matches_type(AsyncMyCursorIDPage[Price], price, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncStripe) -> None: response = await async_client.prices.with_raw_response.list() @@ -342,7 +327,6 @@ async def test_raw_response_list(self, async_client: AsyncStripe) -> None: price = await response.parse() assert_matches_type(AsyncMyCursorIDPage[Price], price, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncStripe) -> None: async with async_client.prices.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_products.py b/tests/api_resources/test_products.py index 444963b..37da869 100644 --- a/tests/api_resources/test_products.py +++ b/tests/api_resources/test_products.py @@ -18,7 +18,6 @@ class TestProducts: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Stripe) -> None: product = client.products.create( @@ -26,7 +25,6 @@ def test_method_create(self, client: Stripe) -> None: ) assert_matches_type(Product, product, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Stripe) -> None: product = client.products.create( @@ -91,7 +89,6 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(Product, product, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Stripe) -> None: response = client.products.with_raw_response.create( @@ -103,7 +100,6 @@ def test_raw_response_create(self, client: Stripe) -> None: product = response.parse() assert_matches_type(Product, product, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Stripe) -> None: with client.products.with_streaming_response.create( @@ -117,13 +113,11 @@ def test_streaming_response_create(self, client: Stripe) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Stripe) -> None: product = client.products.list() assert_matches_type(SyncMyCursorIDPage[Product], product, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Stripe) -> None: product = client.products.list( @@ -144,7 +138,6 @@ def test_method_list_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(SyncMyCursorIDPage[Product], product, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Stripe) -> None: response = client.products.with_raw_response.list() @@ -154,7 +147,6 @@ def test_raw_response_list(self, client: Stripe) -> None: product = response.parse() assert_matches_type(SyncMyCursorIDPage[Product], product, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Stripe) -> None: with client.products.with_streaming_response.list() as response: @@ -172,7 +164,6 @@ class TestAsyncProducts: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncStripe) -> None: product = await async_client.products.create( @@ -180,7 +171,6 @@ async def test_method_create(self, async_client: AsyncStripe) -> None: ) assert_matches_type(Product, product, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> None: product = await async_client.products.create( @@ -245,7 +235,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> ) assert_matches_type(Product, product, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncStripe) -> None: response = await async_client.products.with_raw_response.create( @@ -257,7 +246,6 @@ async def test_raw_response_create(self, async_client: AsyncStripe) -> None: product = await response.parse() assert_matches_type(Product, product, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncStripe) -> None: async with async_client.products.with_streaming_response.create( @@ -271,13 +259,11 @@ async def test_streaming_response_create(self, async_client: AsyncStripe) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncStripe) -> None: product = await async_client.products.list() assert_matches_type(AsyncMyCursorIDPage[Product], product, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> None: product = await async_client.products.list( @@ -298,7 +284,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> N ) assert_matches_type(AsyncMyCursorIDPage[Product], product, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncStripe) -> None: response = await async_client.products.with_raw_response.list() @@ -308,7 +293,6 @@ async def test_raw_response_list(self, async_client: AsyncStripe) -> None: product = await response.parse() assert_matches_type(AsyncMyCursorIDPage[Product], product, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncStripe) -> None: async with async_client.products.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_refunds.py b/tests/api_resources/test_refunds.py index bd78bea..025f578 100644 --- a/tests/api_resources/test_refunds.py +++ b/tests/api_resources/test_refunds.py @@ -17,13 +17,11 @@ class TestRefunds: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Stripe) -> None: refund = client.refunds.create() assert_matches_type(Refund, refund, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Stripe) -> None: refund = client.refunds.create( @@ -42,7 +40,6 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(Refund, refund, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Stripe) -> None: response = client.refunds.with_raw_response.create() @@ -52,7 +49,6 @@ def test_raw_response_create(self, client: Stripe) -> None: refund = response.parse() assert_matches_type(Refund, refund, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Stripe) -> None: with client.refunds.with_streaming_response.create() as response: @@ -70,13 +66,11 @@ class TestAsyncRefunds: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncStripe) -> None: refund = await async_client.refunds.create() assert_matches_type(Refund, refund, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> None: refund = await async_client.refunds.create( @@ -95,7 +89,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> ) assert_matches_type(Refund, refund, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncStripe) -> None: response = await async_client.refunds.with_raw_response.create() @@ -105,7 +98,6 @@ async def test_raw_response_create(self, async_client: AsyncStripe) -> None: refund = await response.parse() assert_matches_type(Refund, refund, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncStripe) -> None: async with async_client.refunds.with_streaming_response.create() as response: diff --git a/tests/api_resources/test_subscriptions.py b/tests/api_resources/test_subscriptions.py index 82cab74..521f96b 100644 --- a/tests/api_resources/test_subscriptions.py +++ b/tests/api_resources/test_subscriptions.py @@ -20,7 +20,6 @@ class TestSubscriptions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Stripe) -> None: subscription = client.subscriptions.update( @@ -28,7 +27,6 @@ def test_method_update(self, client: Stripe) -> None: ) assert_matches_type(Subscription, subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Stripe) -> None: subscription = client.subscriptions.update( @@ -202,7 +200,6 @@ def test_method_update_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(Subscription, subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Stripe) -> None: response = client.subscriptions.with_raw_response.update( @@ -214,7 +211,6 @@ def test_raw_response_update(self, client: Stripe) -> None: subscription = response.parse() assert_matches_type(Subscription, subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Stripe) -> None: with client.subscriptions.with_streaming_response.update( @@ -228,7 +224,6 @@ def test_streaming_response_update(self, client: Stripe) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_update(self, client: Stripe) -> None: with pytest.raises( @@ -238,13 +233,11 @@ def test_path_params_update(self, client: Stripe) -> None: subscription_exposed_id="", ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Stripe) -> None: subscription = client.subscriptions.list() assert_matches_type(SyncMyCursorIDPage[Subscription], subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Stripe) -> None: subscription = client.subscriptions.list( @@ -280,7 +273,6 @@ def test_method_list_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(SyncMyCursorIDPage[Subscription], subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Stripe) -> None: response = client.subscriptions.with_raw_response.list() @@ -290,7 +282,6 @@ def test_raw_response_list(self, client: Stripe) -> None: subscription = response.parse() assert_matches_type(SyncMyCursorIDPage[Subscription], subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Stripe) -> None: with client.subscriptions.with_streaming_response.list() as response: @@ -302,7 +293,6 @@ def test_streaming_response_list(self, client: Stripe) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_cancel(self, client: Stripe) -> None: subscription = client.subscriptions.cancel( @@ -310,7 +300,6 @@ def test_method_cancel(self, client: Stripe) -> None: ) assert_matches_type(Subscription, subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_cancel_with_all_params(self, client: Stripe) -> None: subscription = client.subscriptions.cancel( @@ -325,7 +314,6 @@ def test_method_cancel_with_all_params(self, client: Stripe) -> None: ) assert_matches_type(Subscription, subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_cancel(self, client: Stripe) -> None: response = client.subscriptions.with_raw_response.cancel( @@ -337,7 +325,6 @@ def test_raw_response_cancel(self, client: Stripe) -> None: subscription = response.parse() assert_matches_type(Subscription, subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_cancel(self, client: Stripe) -> None: with client.subscriptions.with_streaming_response.cancel( @@ -351,7 +338,6 @@ def test_streaming_response_cancel(self, client: Stripe) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_cancel(self, client: Stripe) -> None: with pytest.raises( @@ -367,7 +353,6 @@ class TestAsyncSubscriptions: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncStripe) -> None: subscription = await async_client.subscriptions.update( @@ -375,7 +360,6 @@ async def test_method_update(self, async_client: AsyncStripe) -> None: ) assert_matches_type(Subscription, subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncStripe) -> None: subscription = await async_client.subscriptions.update( @@ -549,7 +533,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncStripe) -> ) assert_matches_type(Subscription, subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncStripe) -> None: response = await async_client.subscriptions.with_raw_response.update( @@ -561,7 +544,6 @@ async def test_raw_response_update(self, async_client: AsyncStripe) -> None: subscription = await response.parse() assert_matches_type(Subscription, subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncStripe) -> None: async with async_client.subscriptions.with_streaming_response.update( @@ -575,7 +557,6 @@ async def test_streaming_response_update(self, async_client: AsyncStripe) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncStripe) -> None: with pytest.raises( @@ -585,13 +566,11 @@ async def test_path_params_update(self, async_client: AsyncStripe) -> None: subscription_exposed_id="", ) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncStripe) -> None: subscription = await async_client.subscriptions.list() assert_matches_type(AsyncMyCursorIDPage[Subscription], subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> None: subscription = await async_client.subscriptions.list( @@ -627,7 +606,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> N ) assert_matches_type(AsyncMyCursorIDPage[Subscription], subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncStripe) -> None: response = await async_client.subscriptions.with_raw_response.list() @@ -637,7 +615,6 @@ async def test_raw_response_list(self, async_client: AsyncStripe) -> None: subscription = await response.parse() assert_matches_type(AsyncMyCursorIDPage[Subscription], subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncStripe) -> None: async with async_client.subscriptions.with_streaming_response.list() as response: @@ -649,7 +626,6 @@ async def test_streaming_response_list(self, async_client: AsyncStripe) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_cancel(self, async_client: AsyncStripe) -> None: subscription = await async_client.subscriptions.cancel( @@ -657,7 +633,6 @@ async def test_method_cancel(self, async_client: AsyncStripe) -> None: ) assert_matches_type(Subscription, subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_cancel_with_all_params(self, async_client: AsyncStripe) -> None: subscription = await async_client.subscriptions.cancel( @@ -672,7 +647,6 @@ async def test_method_cancel_with_all_params(self, async_client: AsyncStripe) -> ) assert_matches_type(Subscription, subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_cancel(self, async_client: AsyncStripe) -> None: response = await async_client.subscriptions.with_raw_response.cancel( @@ -684,7 +658,6 @@ async def test_raw_response_cancel(self, async_client: AsyncStripe) -> None: subscription = await response.parse() assert_matches_type(Subscription, subscription, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_cancel(self, async_client: AsyncStripe) -> None: async with async_client.subscriptions.with_streaming_response.cancel( @@ -698,7 +671,6 @@ async def test_streaming_response_cancel(self, async_client: AsyncStripe) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_cancel(self, async_client: AsyncStripe) -> None: with pytest.raises( From 3847ce1c5966a6ec456b3c831c7b275f37c17b34 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 20:59:14 +0000 Subject: [PATCH 04/41] chore: bump @stdy/cli to 0.15.3 --- scripts/mock | 4 ++-- scripts/test | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/mock b/scripts/mock index f434edf..ab11f55 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stdy/cli@0.15.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.15.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.15.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.15.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index f53175d..f33777e 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.15.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.15.3 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From 1b8ece00e53ee181f69119e1925c24afc2319428 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 04:14:32 +0000 Subject: [PATCH 05/41] chore(tests): bump @stdy/cli to 0.16.1 --- scripts/mock | 26 +++++++++++++++++--------- scripts/test | 2 +- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/scripts/mock b/scripts/mock index ab11f55..d995787 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,21 +21,29 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stdy/cli@0.15.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.16.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & - # Wait for server to come online + # Wait for server to come online via health endpoint (max 5s) echo -n "Waiting for server" - while ! grep -q "ERROR\|Steady server listening on" ".stdy.log" ; do + attempts=0 + while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do + if ! kill -0 $! 2>/dev/null; then + echo + cat .stdy.log + exit 1 + fi + attempts=$((attempts + 1)) + if [ "$attempts" -ge 50 ]; then + echo + echo "Timed out waiting for Steady server to start" + cat .stdy.log + exit 1 + fi echo -n "." sleep 0.1 done - if grep -q "ERROR" ".stdy.log"; then - cat .stdy.log - exit 1 - fi - echo else - npm exec --package=@stdy/cli@0.15.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.16.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index f33777e..f10bf2f 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.15.3 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.16.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From bcd27117fb081aa59df24e034678c8dea078259b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 04:57:29 +0000 Subject: [PATCH 06/41] chore: update mock server docs --- CONTRIBUTING.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b9dc8f5..088a7ba 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,11 +85,10 @@ $ pip install ./path-to-wheel-file.whl ## Running tests -Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. +Most tests require you to [set up a mock server](https://github.com/dgellow/steady) against the OpenAPI spec to run the tests. ```sh -# you will need npm installed -$ npx prism mock path/to/your/openapi.yml +$ ./scripts/mock ``` ```sh From e306ac08b2eb0d0385aa5d26c6b540a1988382eb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Feb 2026 04:27:19 +0000 Subject: [PATCH 07/41] chore(tests): bump mock server version --- scripts/mock | 4 ++-- scripts/test | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/mock b/scripts/mock index d995787..1eb7186 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stdy/cli@0.16.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.17.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 5s) echo -n "Waiting for server" @@ -45,5 +45,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.16.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.17.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index f10bf2f..2111d06 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.16.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.17.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From fa41519a4d2313962ac322d782d1f70265b6d0ba Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 05:11:41 +0000 Subject: [PATCH 08/41] chore(internal): add request options to SSE classes --- src/stainless_commons_stripe/_response.py | 3 +++ src/stainless_commons_stripe/_streaming.py | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/stainless_commons_stripe/_response.py b/src/stainless_commons_stripe/_response.py index c338c87..4c59a8c 100644 --- a/src/stainless_commons_stripe/_response.py +++ b/src/stainless_commons_stripe/_response.py @@ -152,6 +152,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: ), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -162,6 +163,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=extract_stream_chunk_type(self._stream_cls), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -175,6 +177,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=cast_to, response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) diff --git a/src/stainless_commons_stripe/_streaming.py b/src/stainless_commons_stripe/_streaming.py index 73e3077..22ce352 100644 --- a/src/stainless_commons_stripe/_streaming.py +++ b/src/stainless_commons_stripe/_streaming.py @@ -4,7 +4,7 @@ import json import inspect from types import TracebackType -from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast +from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable import httpx @@ -13,6 +13,7 @@ if TYPE_CHECKING: from ._client import Stripe, AsyncStripe + from ._models import FinalRequestOptions _T = TypeVar("_T") @@ -22,7 +23,7 @@ class Stream(Generic[_T]): """Provides the core interface to iterate over a synchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEBytesDecoder def __init__( @@ -31,10 +32,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: Stripe, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() @@ -85,7 +88,7 @@ class AsyncStream(Generic[_T]): """Provides the core interface to iterate over an asynchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEDecoder | SSEBytesDecoder def __init__( @@ -94,10 +97,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: AsyncStripe, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() From 09dfc739821286e53d3faef95946384e7de6ed7a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 05:22:14 +0000 Subject: [PATCH 09/41] chore(internal): make `test_proxy_environment_variables` more resilient --- tests/test_client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_client.py b/tests/test_client.py index 8cc425d..55b37a3 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -954,6 +954,8 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + # Delete in case our environment has this set + monkeypatch.delenv("HTTP_PROXY", raising=False) client = DefaultHttpxClient() @@ -1865,6 +1867,8 @@ async def test_get_platform(self) -> None: async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + # Delete in case our environment has this set + monkeypatch.delenv("HTTP_PROXY", raising=False) client = DefaultAsyncHttpxClient() From ee9ae9efd7b7596ed7e9ff7345058fc55df2b9f0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Feb 2026 05:02:15 +0000 Subject: [PATCH 10/41] chore(internal): make `test_proxy_environment_variables` more resilient to env --- tests/test_client.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 55b37a3..99084fa 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -954,8 +954,14 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") - # Delete in case our environment has this set + # Delete in case our environment has any proxy env vars set monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultHttpxClient() @@ -1867,8 +1873,14 @@ async def test_get_platform(self) -> None: async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") - # Delete in case our environment has this set + # Delete in case our environment has any proxy env vars set monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultAsyncHttpxClient() From 44e6bfb11bb60d74b96418f93dad036d5e286d71 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 05:59:48 +0000 Subject: [PATCH 11/41] chore(internal): bump mock server version --- scripts/mock | 4 ++-- scripts/test | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/mock b/scripts/mock index 1eb7186..a8f4f76 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stdy/cli@0.17.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 5s) echo -n "Waiting for server" @@ -45,5 +45,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.17.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 2111d06..a0fd100 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.17.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From e3f69aac9b1c86932148e536fff17919224e4b3d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 06:03:33 +0000 Subject: [PATCH 12/41] chore(ci): bump uv version --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a8d6ea..c3942d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 with: - version: '0.9.13' + version: '0.10.2' - name: Install dependencies run: uv sync --all-extras @@ -46,7 +46,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 with: - version: '0.9.13' + version: '0.10.2' - name: Install dependencies run: uv sync --all-extras @@ -80,7 +80,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 with: - version: '0.9.13' + version: '0.10.2' - name: Bootstrap run: ./scripts/bootstrap From 50a4731ff1da1cf30e789e081d3c0d7cafd977a1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 08:04:28 +0000 Subject: [PATCH 13/41] chore(internal): refactor authentication internals --- src/stainless_commons_stripe/_base_client.py | 34 ++++++++++++++++---- src/stainless_commons_stripe/_client.py | 19 ++++++++--- src/stainless_commons_stripe/_models.py | 6 ++++ src/stainless_commons_stripe/_types.py | 3 +- 4 files changed, 51 insertions(+), 11 deletions(-) diff --git a/src/stainless_commons_stripe/_base_client.py b/src/stainless_commons_stripe/_base_client.py index 7eaa1d2..ab66690 100644 --- a/src/stainless_commons_stripe/_base_client.py +++ b/src/stainless_commons_stripe/_base_client.py @@ -63,7 +63,7 @@ ) from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping from ._compat import PYDANTIC_V1, model_copy, model_dump -from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type +from ._models import GenericModel, SecurityOptions, FinalRequestOptions, validate_type, construct_type from ._response import ( APIResponse, BaseAPIResponse, @@ -432,9 +432,27 @@ def _make_status_error( ) -> _exceptions.APIStatusError: raise NotImplementedError() + def _auth_headers( + self, + security: SecurityOptions, # noqa: ARG002 + ) -> dict[str, str]: + return {} + + def _auth_query( + self, + security: SecurityOptions, # noqa: ARG002 + ) -> dict[str, str]: + return {} + + def _custom_auth( + self, + security: SecurityOptions, # noqa: ARG002 + ) -> httpx.Auth | None: + return None + def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0) -> httpx.Headers: custom_headers = options.headers or {} - headers_dict = _merge_mappings(self.default_headers, custom_headers) + headers_dict = _merge_mappings({**self._auth_headers(options.security), **self.default_headers}, custom_headers) self._validate_headers(headers_dict, custom_headers) # headers are case-insensitive while dictionaries are not. @@ -506,7 +524,7 @@ def _build_request( raise RuntimeError(f"Unexpected JSON data type, {type(json_data)}, cannot merge with `extra_body`") headers = self._build_headers(options, retries_taken=retries_taken) - params = _merge_mappings(self.default_query, options.params) + params = _merge_mappings({**self._auth_query(options.security), **self.default_query}, options.params) content_type = headers.get("Content-Type") files = options.files @@ -671,7 +689,6 @@ def default_headers(self) -> dict[str, str | Omit]: "Content-Type": "application/json", "User-Agent": self.user_agent, **self.platform_headers(), - **self.auth_headers, **self._custom_headers, } @@ -990,8 +1007,9 @@ def request( self._prepare_request(request) kwargs: HttpxSendArgs = {} - if self.custom_auth is not None: - kwargs["auth"] = self.custom_auth + custom_auth = self._custom_auth(options.security) + if custom_auth is not None: + kwargs["auth"] = custom_auth if options.follow_redirects is not None: kwargs["follow_redirects"] = options.follow_redirects @@ -1952,6 +1970,7 @@ def make_request_options( idempotency_key: str | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, post_parser: PostParser | NotGiven = not_given, + security: SecurityOptions | None = None, ) -> RequestOptions: """Create a dict of type RequestOptions without keys of NotGiven values.""" options: RequestOptions = {} @@ -1977,6 +1996,9 @@ def make_request_options( # internal options["post_parser"] = post_parser # type: ignore + if security is not None: + options["security"] = security + return options diff --git a/src/stainless_commons_stripe/_client.py b/src/stainless_commons_stripe/_client.py index 3339fe5..5d1d51f 100644 --- a/src/stainless_commons_stripe/_client.py +++ b/src/stainless_commons_stripe/_client.py @@ -22,6 +22,7 @@ ) from ._utils import is_given, get_async_library from ._compat import cached_property +from ._models import SecurityOptions from ._version import __version__ from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import APIStatusError @@ -206,9 +207,14 @@ def with_streaming_response(self) -> StripeWithStreamedResponse: def qs(self) -> Querystring: return Querystring(array_format="brackets") - @property @override - def auth_headers(self) -> dict[str, str]: + def _auth_headers(self, security: SecurityOptions) -> dict[str, str]: + return { + **(self._bearer_auth if security.get("bearer_auth", False) else {}), + } + + @property + def _bearer_auth(self) -> dict[str, str]: api_key = self.api_key if api_key is None: return {} @@ -459,9 +465,14 @@ def with_streaming_response(self) -> AsyncStripeWithStreamedResponse: def qs(self) -> Querystring: return Querystring(array_format="brackets") - @property @override - def auth_headers(self) -> dict[str, str]: + def _auth_headers(self, security: SecurityOptions) -> dict[str, str]: + return { + **(self._bearer_auth if security.get("bearer_auth", False) else {}), + } + + @property + def _bearer_auth(self) -> dict[str, str]: api_key = self.api_key if api_key is None: return {} diff --git a/src/stainless_commons_stripe/_models.py b/src/stainless_commons_stripe/_models.py index 29070e0..e22dd2a 100644 --- a/src/stainless_commons_stripe/_models.py +++ b/src/stainless_commons_stripe/_models.py @@ -791,6 +791,10 @@ def _create_pydantic_model(type_: _T) -> Type[RootModel[_T]]: return RootModel[type_] # type: ignore +class SecurityOptions(TypedDict, total=False): + bearer_auth: bool + + class FinalRequestOptionsInput(TypedDict, total=False): method: Required[str] url: Required[str] @@ -804,6 +808,7 @@ class FinalRequestOptionsInput(TypedDict, total=False): json_data: Body extra_json: AnyMapping follow_redirects: bool + security: SecurityOptions @final @@ -818,6 +823,7 @@ class FinalRequestOptions(pydantic.BaseModel): idempotency_key: Union[str, None] = None post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven() follow_redirects: Union[bool, None] = None + security: SecurityOptions = {"bearer_auth": True} content: Union[bytes, bytearray, IO[bytes], Iterable[bytes], AsyncIterable[bytes], None] = None # It should be noted that we cannot use `json` here as that would override diff --git a/src/stainless_commons_stripe/_types.py b/src/stainless_commons_stripe/_types.py index aa08657..fea0825 100644 --- a/src/stainless_commons_stripe/_types.py +++ b/src/stainless_commons_stripe/_types.py @@ -36,7 +36,7 @@ from httpx import URL, Proxy, Timeout, Response, BaseTransport, AsyncBaseTransport if TYPE_CHECKING: - from ._models import BaseModel + from ._models import BaseModel, SecurityOptions from ._response import APIResponse, AsyncAPIResponse Transport = BaseTransport @@ -121,6 +121,7 @@ class RequestOptions(TypedDict, total=False): extra_json: AnyMapping idempotency_key: str follow_redirects: bool + security: SecurityOptions # Sentinel class used until PEP 0661 is accepted From 80e449622d08e15eaba286c60f12955ff49cb051 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 06:57:29 +0000 Subject: [PATCH 14/41] chore(internal): codegen related update --- scripts/mock | 4 ++-- scripts/test | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/mock b/scripts/mock index a8f4f76..a1d0fff 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stdy/cli@0.19.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 5s) echo -n "Waiting for server" @@ -45,5 +45,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index a0fd100..ef61858 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.3 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From 73fc33bf6ba7759a4bf5b8ce672f4866d744f628 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 07:17:03 +0000 Subject: [PATCH 15/41] chore(test): do not count install time for mock server timeout --- scripts/mock | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/mock b/scripts/mock index a1d0fff..3d1d19c 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,9 +21,12 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then + # Pre-install the package so the download doesn't eat into the startup timeout + npm exec --package=@stdy/cli@0.19.3 -- steady --version + npm exec --package=@stdy/cli@0.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & - # Wait for server to come online via health endpoint (max 5s) + # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" attempts=0 while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do @@ -33,7 +36,7 @@ if [ "$1" == "--daemon" ]; then exit 1 fi attempts=$((attempts + 1)) - if [ "$attempts" -ge 50 ]; then + if [ "$attempts" -ge 300 ]; then echo echo "Timed out waiting for Steady server to start" cat .stdy.log From 3cd37254e2c8d4f81525c91263b6d76ce234250a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Mar 2026 16:54:03 +0000 Subject: [PATCH 16/41] chore(ci): skip uploading artifacts on stainless-internal branches --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3942d3..cf13f0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,14 +55,18 @@ jobs: run: uv build - name: Get GitHub OIDC Token - if: github.repository == 'stainless-sdks/stripe-minimal-python' + if: |- + github.repository == 'stainless-sdks/stripe-minimal-python' && + !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball - if: github.repository == 'stainless-sdks/stripe-minimal-python' + if: |- + github.repository == 'stainless-sdks/stripe-minimal-python' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} From 0449b453ecc7f71d93c2e027a20d452ad3ab7c87 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 05:07:24 +0000 Subject: [PATCH 17/41] fix(pydantic): do not pass `by_alias` unless set --- src/stainless_commons_stripe/_compat.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/stainless_commons_stripe/_compat.py b/src/stainless_commons_stripe/_compat.py index 786ff42..e6690a4 100644 --- a/src/stainless_commons_stripe/_compat.py +++ b/src/stainless_commons_stripe/_compat.py @@ -2,7 +2,7 @@ from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload from datetime import date, datetime -from typing_extensions import Self, Literal +from typing_extensions import Self, Literal, TypedDict import pydantic from pydantic.fields import FieldInfo @@ -131,6 +131,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: return model.model_dump_json(indent=indent) +class _ModelDumpKwargs(TypedDict, total=False): + by_alias: bool + + def model_dump( model: pydantic.BaseModel, *, @@ -142,6 +146,9 @@ def model_dump( by_alias: bool | None = None, ) -> dict[str, Any]: if (not PYDANTIC_V1) or hasattr(model, "model_dump"): + kwargs: _ModelDumpKwargs = {} + if by_alias is not None: + kwargs["by_alias"] = by_alias return model.model_dump( mode=mode, exclude=exclude, @@ -149,7 +156,7 @@ def model_dump( exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 warnings=True if PYDANTIC_V1 else warnings, - by_alias=by_alias, + **kwargs, ) return cast( "dict[str, Any]", From a345ecd2ac41ef6d61458b205ed98319a524f0c8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 05:11:41 +0000 Subject: [PATCH 18/41] fix(deps): bump minimum typing-extensions version --- pyproject.toml | 2 +- uv.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 28d975d..cfc1218 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ authors = [ dependencies = [ "httpx>=0.23.0, <1", "pydantic>=1.9.0, <3", - "typing-extensions>=4.10, <5", + "typing-extensions>=4.14, <5", "anyio>=3.5.0, <5", "distro>=1.7.0, <2", "sniffio", diff --git a/uv.lock b/uv.lock index bd63043..0735ebd 100644 --- a/uv.lock +++ b/uv.lock @@ -1385,7 +1385,7 @@ requires-dist = [ { name = "httpx-aiohttp", marker = "extra == 'aiohttp'", specifier = ">=0.1.9" }, { name = "pydantic", specifier = ">=1.9.0,<3" }, { name = "sniffio" }, - { name = "typing-extensions", specifier = ">=4.10,<5" }, + { name = "typing-extensions", specifier = ">=4.14,<5" }, ] provides-extras = ["aiohttp"] From 0aafb30d64e513a37c14551533fabf353026ed13 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 05:14:21 +0000 Subject: [PATCH 19/41] chore(internal): tweak CI branches --- .github/workflows/ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf13f0c..d9cff59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - 'stl-preview-head/**' From 35bfff2629faeada215bcd5ec87892295d9ee500 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 02:27:42 +0000 Subject: [PATCH 20/41] fix: sanitize endpoint path params --- .../_utils/__init__.py | 1 + src/stainless_commons_stripe/_utils/_path.py | 127 ++++++++++++++++++ .../resources/disputes.py | 6 +- .../resources/invoices.py | 6 +- .../resources/subscriptions.py | 18 ++- tests/test_utils/test_path.py | 89 ++++++++++++ 6 files changed, 236 insertions(+), 11 deletions(-) create mode 100644 src/stainless_commons_stripe/_utils/_path.py create mode 100644 tests/test_utils/test_path.py diff --git a/src/stainless_commons_stripe/_utils/__init__.py b/src/stainless_commons_stripe/_utils/__init__.py index dc64e29..10cb66d 100644 --- a/src/stainless_commons_stripe/_utils/__init__.py +++ b/src/stainless_commons_stripe/_utils/__init__.py @@ -1,3 +1,4 @@ +from ._path import path_template as path_template from ._sync import asyncify as asyncify from ._proxy import LazyProxy as LazyProxy from ._utils import ( diff --git a/src/stainless_commons_stripe/_utils/_path.py b/src/stainless_commons_stripe/_utils/_path.py new file mode 100644 index 0000000..4d6e1e4 --- /dev/null +++ b/src/stainless_commons_stripe/_utils/_path.py @@ -0,0 +1,127 @@ +from __future__ import annotations + +import re +from typing import ( + Any, + Mapping, + Callable, +) +from urllib.parse import quote + +# Matches '.' or '..' where each dot is either literal or percent-encoded (%2e / %2E). +_DOT_SEGMENT_RE = re.compile(r"^(?:\.|%2[eE]){1,2}$") + +_PLACEHOLDER_RE = re.compile(r"\{(\w+)\}") + + +def _quote_path_segment_part(value: str) -> str: + """Percent-encode `value` for use in a URI path segment. + + Considers characters not in `pchar` set from RFC 3986 §3.3 to be unsafe. + https://datatracker.ietf.org/doc/html/rfc3986#section-3.3 + """ + # quote() already treats unreserved characters (letters, digits, and -._~) + # as safe, so we only need to add sub-delims, ':', and '@'. + # Notably, unlike the default `safe` for quote(), / is unsafe and must be quoted. + return quote(value, safe="!$&'()*+,;=:@") + + +def _quote_query_part(value: str) -> str: + """Percent-encode `value` for use in a URI query string. + + Considers &, = and characters not in `query` set from RFC 3986 §3.4 to be unsafe. + https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 + """ + return quote(value, safe="!$'()*+,;:@/?") + + +def _quote_fragment_part(value: str) -> str: + """Percent-encode `value` for use in a URI fragment. + + Considers characters not in `fragment` set from RFC 3986 §3.5 to be unsafe. + https://datatracker.ietf.org/doc/html/rfc3986#section-3.5 + """ + return quote(value, safe="!$&'()*+,;=:@/?") + + +def _interpolate( + template: str, + values: Mapping[str, Any], + quoter: Callable[[str], str], +) -> str: + """Replace {name} placeholders in `template`, quoting each value with `quoter`. + + Placeholder names are looked up in `values`. + + Raises: + KeyError: If a placeholder is not found in `values`. + """ + # re.split with a capturing group returns alternating + # [text, name, text, name, ..., text] elements. + parts = _PLACEHOLDER_RE.split(template) + + for i in range(1, len(parts), 2): + name = parts[i] + if name not in values: + raise KeyError(f"a value for placeholder {{{name}}} was not provided") + val = values[name] + if val is None: + parts[i] = "null" + elif isinstance(val, bool): + parts[i] = "true" if val else "false" + else: + parts[i] = quoter(str(values[name])) + + return "".join(parts) + + +def path_template(template: str, /, **kwargs: Any) -> str: + """Interpolate {name} placeholders in `template` from keyword arguments. + + Args: + template: The template string containing {name} placeholders. + **kwargs: Keyword arguments to interpolate into the template. + + Returns: + The template with placeholders interpolated and percent-encoded. + + Safe characters for percent-encoding are dependent on the URI component. + Placeholders in path and fragment portions are percent-encoded where the `segment` + and `fragment` sets from RFC 3986 respectively are considered safe. + Placeholders in the query portion are percent-encoded where the `query` set from + RFC 3986 §3.3 is considered safe except for = and & characters. + + Raises: + KeyError: If a placeholder is not found in `kwargs`. + ValueError: If resulting path contains /./ or /../ segments (including percent-encoded dot-segments). + """ + # Split the template into path, query, and fragment portions. + fragment_template: str | None = None + query_template: str | None = None + + rest = template + if "#" in rest: + rest, fragment_template = rest.split("#", 1) + if "?" in rest: + rest, query_template = rest.split("?", 1) + path_template = rest + + # Interpolate each portion with the appropriate quoting rules. + path_result = _interpolate(path_template, kwargs, _quote_path_segment_part) + + # Reject dot-segments (. and ..) in the final assembled path. The check + # runs after interpolation so that adjacent placeholders or a mix of static + # text and placeholders that together form a dot-segment are caught. + # Also reject percent-encoded dot-segments to protect against incorrectly + # implemented normalization in servers/proxies. + for segment in path_result.split("/"): + if _DOT_SEGMENT_RE.match(segment): + raise ValueError(f"Constructed path {path_result!r} contains dot-segment {segment!r} which is not allowed") + + result = path_result + if query_template is not None: + result += "?" + _interpolate(query_template, kwargs, _quote_query_part) + if fragment_template is not None: + result += "#" + _interpolate(fragment_template, kwargs, _quote_fragment_part) + + return result diff --git a/src/stainless_commons_stripe/resources/disputes.py b/src/stainless_commons_stripe/resources/disputes.py index 5846b23..883a463 100644 --- a/src/stainless_commons_stripe/resources/disputes.py +++ b/src/stainless_commons_stripe/resources/disputes.py @@ -9,7 +9,7 @@ from ..types import dispute_list_params, dispute_update_params from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from .._utils import maybe_transform, async_maybe_transform +from .._utils import path_template, maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( @@ -94,7 +94,7 @@ def update( if not dispute: raise ValueError(f"Expected a non-empty value for `dispute` but received {dispute!r}") return self._post( - f"/v1/disputes/{dispute}", + path_template("/v1/disputes/{dispute}", dispute=dispute), body=maybe_transform( { "evidence": evidence, @@ -255,7 +255,7 @@ async def update( if not dispute: raise ValueError(f"Expected a non-empty value for `dispute` but received {dispute!r}") return await self._post( - f"/v1/disputes/{dispute}", + path_template("/v1/disputes/{dispute}", dispute=dispute), body=await async_maybe_transform( { "evidence": evidence, diff --git a/src/stainless_commons_stripe/resources/invoices.py b/src/stainless_commons_stripe/resources/invoices.py index fda84df..37a8955 100644 --- a/src/stainless_commons_stripe/resources/invoices.py +++ b/src/stainless_commons_stripe/resources/invoices.py @@ -9,7 +9,7 @@ from ..types import invoice_list_params, invoice_create_params, invoice_finalize_params from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from .._utils import maybe_transform, async_maybe_transform +from .._utils import path_template, maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( @@ -397,7 +397,7 @@ def finalize( if not invoice: raise ValueError(f"Expected a non-empty value for `invoice` but received {invoice!r}") return self._post( - f"/v1/invoices/{invoice}/finalize", + path_template("/v1/invoices/{invoice}/finalize", invoice=invoice), body=maybe_transform( { "auto_advance": auto_advance, @@ -784,7 +784,7 @@ async def finalize( if not invoice: raise ValueError(f"Expected a non-empty value for `invoice` but received {invoice!r}") return await self._post( - f"/v1/invoices/{invoice}/finalize", + path_template("/v1/invoices/{invoice}/finalize", invoice=invoice), body=await async_maybe_transform( { "auto_advance": auto_advance, diff --git a/src/stainless_commons_stripe/resources/subscriptions.py b/src/stainless_commons_stripe/resources/subscriptions.py index 35d7f22..ef67a0f 100644 --- a/src/stainless_commons_stripe/resources/subscriptions.py +++ b/src/stainless_commons_stripe/resources/subscriptions.py @@ -9,7 +9,7 @@ from ..types import subscription_list_params, subscription_cancel_params, subscription_update_params from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from .._utils import maybe_transform, async_maybe_transform +from .._utils import path_template, maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( @@ -287,7 +287,9 @@ def update( f"Expected a non-empty value for `subscription_exposed_id` but received {subscription_exposed_id!r}" ) return self._post( - f"/v1/subscriptions/{subscription_exposed_id}", + path_template( + "/v1/subscriptions/{subscription_exposed_id}", subscription_exposed_id=subscription_exposed_id + ), body=maybe_transform( { "add_invoice_items": add_invoice_items, @@ -504,7 +506,9 @@ def cancel( f"Expected a non-empty value for `subscription_exposed_id` but received {subscription_exposed_id!r}" ) return self._delete( - f"/v1/subscriptions/{subscription_exposed_id}", + path_template( + "/v1/subscriptions/{subscription_exposed_id}", subscription_exposed_id=subscription_exposed_id + ), body=maybe_transform( { "cancellation_details": cancellation_details, @@ -783,7 +787,9 @@ async def update( f"Expected a non-empty value for `subscription_exposed_id` but received {subscription_exposed_id!r}" ) return await self._post( - f"/v1/subscriptions/{subscription_exposed_id}", + path_template( + "/v1/subscriptions/{subscription_exposed_id}", subscription_exposed_id=subscription_exposed_id + ), body=await async_maybe_transform( { "add_invoice_items": add_invoice_items, @@ -1000,7 +1006,9 @@ async def cancel( f"Expected a non-empty value for `subscription_exposed_id` but received {subscription_exposed_id!r}" ) return await self._delete( - f"/v1/subscriptions/{subscription_exposed_id}", + path_template( + "/v1/subscriptions/{subscription_exposed_id}", subscription_exposed_id=subscription_exposed_id + ), body=await async_maybe_transform( { "cancellation_details": cancellation_details, diff --git a/tests/test_utils/test_path.py b/tests/test_utils/test_path.py new file mode 100644 index 0000000..fc72d8f --- /dev/null +++ b/tests/test_utils/test_path.py @@ -0,0 +1,89 @@ +from __future__ import annotations + +from typing import Any + +import pytest + +from stainless_commons_stripe._utils._path import path_template + + +@pytest.mark.parametrize( + "template, kwargs, expected", + [ + ("/v1/{id}", dict(id="abc"), "/v1/abc"), + ("/v1/{a}/{b}", dict(a="x", b="y"), "/v1/x/y"), + ("/v1/{a}{b}/path/{c}?val={d}#{e}", dict(a="x", b="y", c="z", d="u", e="v"), "/v1/xy/path/z?val=u#v"), + ("/{w}/{w}", dict(w="echo"), "/echo/echo"), + ("/v1/static", {}, "/v1/static"), + ("", {}, ""), + ("/v1/?q={n}&count=10", dict(n=42), "/v1/?q=42&count=10"), + ("/v1/{v}", dict(v=None), "/v1/null"), + ("/v1/{v}", dict(v=True), "/v1/true"), + ("/v1/{v}", dict(v=False), "/v1/false"), + ("/v1/{v}", dict(v=".hidden"), "/v1/.hidden"), # dot prefix ok + ("/v1/{v}", dict(v="file.txt"), "/v1/file.txt"), # dot in middle ok + ("/v1/{v}", dict(v="..."), "/v1/..."), # triple dot ok + ("/v1/{a}{b}", dict(a=".", b="txt"), "/v1/.txt"), # dot var combining with adjacent to be ok + ("/items?q={v}#{f}", dict(v=".", f=".."), "/items?q=.#.."), # dots in query/fragment are fine + ( + "/v1/{a}?query={b}", + dict(a="../../other/endpoint", b="a&bad=true"), + "/v1/..%2F..%2Fother%2Fendpoint?query=a%26bad%3Dtrue", + ), + ("/v1/{val}", dict(val="a/b/c"), "/v1/a%2Fb%2Fc"), + ("/v1/{val}", dict(val="a/b/c?query=value"), "/v1/a%2Fb%2Fc%3Fquery=value"), + ("/v1/{val}", dict(val="a/b/c?query=value&bad=true"), "/v1/a%2Fb%2Fc%3Fquery=value&bad=true"), + ("/v1/{val}", dict(val="%20"), "/v1/%2520"), # escapes escape sequences in input + # Query: slash and ? are safe, # is not + ("/items?q={v}", dict(v="a/b"), "/items?q=a/b"), + ("/items?q={v}", dict(v="a?b"), "/items?q=a?b"), + ("/items?q={v}", dict(v="a#b"), "/items?q=a%23b"), + ("/items?q={v}", dict(v="a b"), "/items?q=a%20b"), + # Fragment: slash and ? are safe + ("/docs#{v}", dict(v="a/b"), "/docs#a/b"), + ("/docs#{v}", dict(v="a?b"), "/docs#a?b"), + # Path: slash, ? and # are all encoded + ("/v1/{v}", dict(v="a/b"), "/v1/a%2Fb"), + ("/v1/{v}", dict(v="a?b"), "/v1/a%3Fb"), + ("/v1/{v}", dict(v="a#b"), "/v1/a%23b"), + # same var encoded differently by component + ( + "/v1/{v}?q={v}#{v}", + dict(v="a/b?c#d"), + "/v1/a%2Fb%3Fc%23d?q=a/b?c%23d#a/b?c%23d", + ), + ("/v1/{val}", dict(val="x?admin=true"), "/v1/x%3Fadmin=true"), # query injection + ("/v1/{val}", dict(val="x#admin"), "/v1/x%23admin"), # fragment injection + ], +) +def test_interpolation(template: str, kwargs: dict[str, Any], expected: str) -> None: + assert path_template(template, **kwargs) == expected + + +def test_missing_kwarg_raises_key_error() -> None: + with pytest.raises(KeyError, match="org_id"): + path_template("/v1/{org_id}") + + +@pytest.mark.parametrize( + "template, kwargs", + [ + ("{a}/path", dict(a=".")), + ("{a}/path", dict(a="..")), + ("/v1/{a}", dict(a=".")), + ("/v1/{a}", dict(a="..")), + ("/v1/{a}/path", dict(a=".")), + ("/v1/{a}/path", dict(a="..")), + ("/v1/{a}{b}", dict(a=".", b=".")), # adjacent vars → ".." + ("/v1/{a}.", dict(a=".")), # var + static → ".." + ("/v1/{a}{b}", dict(a="", b=".")), # empty + dot → "." + ("/v1/%2e/{x}", dict(x="ok")), # encoded dot in static text + ("/v1/%2e./{x}", dict(x="ok")), # mixed encoded ".." in static + ("/v1/.%2E/{x}", dict(x="ok")), # mixed encoded ".." in static + ("/v1/{v}?q=1", dict(v="..")), + ("/v1/{v}#frag", dict(v="..")), + ], +) +def test_dot_segment_rejected(template: str, kwargs: dict[str, Any]) -> None: + with pytest.raises(ValueError, match="dot-segment"): + path_template(template, **kwargs) From 5411b66e3ecf143da5fd0d2280bb35a07b192585 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Mar 2026 02:46:42 +0000 Subject: [PATCH 21/41] chore(tests): bump steady to v0.19.4 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index 3d1d19c..e2ca85a 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.3 -- steady --version + npm exec --package=@stdy/cli@0.19.4 -- steady --version - npm exec --package=@stdy/cli@0.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.4 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.4 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index ef61858..624e6d9 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.3 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.4 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From f2d5d329055049db5a46643a3d531e210b69028a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Mar 2026 02:53:12 +0000 Subject: [PATCH 22/41] chore(tests): bump steady to v0.19.5 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index e2ca85a..4f7dfd1 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.4 -- steady --version + npm exec --package=@stdy/cli@0.19.5 -- steady --version - npm exec --package=@stdy/cli@0.19.4 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.4 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 624e6d9..d612647 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.4 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.5 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From 468b5ec187aea033e4b993334e6a58d4004ea2c9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 02:55:35 +0000 Subject: [PATCH 23/41] chore(internal): update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 95ceb18..3824f4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .prism.log +.stdy.log _dev __pycache__ From fee581fddb74d78b5dc980cd98037291b1a1368b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 03:04:44 +0000 Subject: [PATCH 24/41] chore(tests): bump steady to v0.19.6 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index 4f7dfd1..dba3058 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.5 -- steady --version + npm exec --package=@stdy/cli@0.19.6 -- steady --version - npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.6 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.6 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index d612647..831a949 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.5 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.6 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From d93c7cffbc6b2219bd7daefe997c900fea976fdc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 02:29:18 +0000 Subject: [PATCH 25/41] chore(ci): skip lint on metadata-only changes Note that we still want to run tests, as these depend on the metadata. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9cff59..8718d05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/stripe-minimal-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@v6 @@ -35,7 +35,7 @@ jobs: run: ./scripts/lint build: - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') timeout-minutes: 10 name: build permissions: From 24b91efc0b1d6fc51c673701a09a8e80dfb57590 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 02:30:40 +0000 Subject: [PATCH 26/41] chore(tests): bump steady to v0.19.7 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index dba3058..9ecceca 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.6 -- steady --version + npm exec --package=@stdy/cli@0.19.7 -- steady --version - npm exec --package=@stdy/cli@0.19.6 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.6 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 831a949..aa01302 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.6 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From 17ab3f3c1d2dadb6f357a9e61df025bd4ee0129a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Mar 2026 03:48:48 +0000 Subject: [PATCH 27/41] feat(internal): implement indices array format for query and form serialization --- scripts/mock | 4 ++-- scripts/test | 2 +- src/stainless_commons_stripe/_qs.py | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index 9ecceca..4931f30 100755 --- a/scripts/mock +++ b/scripts/mock @@ -24,7 +24,7 @@ if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout npm exec --package=@stdy/cli@0.19.7 -- steady --version - npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index aa01302..5653093 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 diff --git a/src/stainless_commons_stripe/_qs.py b/src/stainless_commons_stripe/_qs.py index ada6fd3..de8c99b 100644 --- a/src/stainless_commons_stripe/_qs.py +++ b/src/stainless_commons_stripe/_qs.py @@ -101,7 +101,10 @@ def _stringify_item( items.extend(self._stringify_item(key, item, opts)) return items elif array_format == "indices": - raise NotImplementedError("The array indices format is not supported yet") + items = [] + for i, item in enumerate(value): + items.extend(self._stringify_item(f"{key}[{i}]", item, opts)) + return items elif array_format == "brackets": items = [] key = key + "[]" From 2cdebcb70d3b9e880766370c8f140bf5b615a4b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 04:57:38 +0000 Subject: [PATCH 28/41] chore(tests): bump steady to v0.20.1 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index 4931f30..8b82c3e 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.7 -- steady --version + npm exec --package=@stdy/cli@0.20.1 -- steady --version - npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 5653093..ce56f7f 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 From c62b77b128486421f209a4d36cd376a363224960 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 05:02:37 +0000 Subject: [PATCH 29/41] chore(tests): bump steady to v0.20.2 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index 8b82c3e..886f2ff 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.20.1 -- steady --version + npm exec --package=@stdy/cli@0.20.2 -- steady --version - npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index ce56f7f..b74e1b2 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.2 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 From fb89f44fe38a01b3fd386ea71c2db9b26a5963dc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 03:33:01 +0000 Subject: [PATCH 30/41] fix(client): preserve hardcoded query params when merging with user params --- src/stainless_commons_stripe/_base_client.py | 4 ++ tests/test_client.py | 48 ++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/src/stainless_commons_stripe/_base_client.py b/src/stainless_commons_stripe/_base_client.py index ab66690..42ddbc6 100644 --- a/src/stainless_commons_stripe/_base_client.py +++ b/src/stainless_commons_stripe/_base_client.py @@ -558,6 +558,10 @@ def _build_request( files = cast(HttpxRequestFiles, ForceMultipartDict()) prepared_url = self._prepare_url(options.url) + # preserve hard-coded query params from the url + if params and prepared_url.query: + params = {**dict(prepared_url.params.items()), **params} + prepared_url = prepared_url.copy_with(raw_path=prepared_url.raw_path.split(b"?", 1)[0]) if "_" in prepared_url.host: # work around https://github.com/encode/httpx/discussions/2880 kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")} diff --git a/tests/test_client.py b/tests/test_client.py index 99084fa..efcbbaa 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -436,6 +436,30 @@ def test_default_query_option(self) -> None: client.close() + def test_hardcoded_query_params_in_url(self, client: Stripe) -> None: + request = client._build_request(FinalRequestOptions(method="get", url="/foo?beta=true")) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true"} + + request = client._build_request( + FinalRequestOptions( + method="get", + url="/foo?beta=true", + params={"limit": "10", "page": "abc"}, + ) + ) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true", "limit": "10", "page": "abc"} + + request = client._build_request( + FinalRequestOptions( + method="get", + url="/files/a%2Fb?beta=true", + params={"limit": "10"}, + ) + ) + assert request.url.raw_path == b"/files/a%2Fb?beta=true&limit=10" + def test_request_extra_json(self, client: Stripe) -> None: request = client._build_request( FinalRequestOptions( @@ -1336,6 +1360,30 @@ async def test_default_query_option(self) -> None: await client.close() + async def test_hardcoded_query_params_in_url(self, async_client: AsyncStripe) -> None: + request = async_client._build_request(FinalRequestOptions(method="get", url="/foo?beta=true")) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true"} + + request = async_client._build_request( + FinalRequestOptions( + method="get", + url="/foo?beta=true", + params={"limit": "10", "page": "abc"}, + ) + ) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true", "limit": "10", "page": "abc"} + + request = async_client._build_request( + FinalRequestOptions( + method="get", + url="/files/a%2Fb?beta=true", + params={"limit": "10"}, + ) + ) + assert request.url.raw_path == b"/files/a%2Fb?beta=true&limit=10" + def test_request_extra_json(self, client: Stripe) -> None: request = client._build_request( FinalRequestOptions( From 9099ed6e7425449bf0e0579f53b6ea141787d3f2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 11 Apr 2026 05:30:57 +0000 Subject: [PATCH 31/41] fix: ensure file data are only sent as 1 parameter --- src/stainless_commons_stripe/_utils/_utils.py | 5 +++-- tests/test_extract_files.py | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/stainless_commons_stripe/_utils/_utils.py b/src/stainless_commons_stripe/_utils/_utils.py index eec7f4a..63b8cd6 100644 --- a/src/stainless_commons_stripe/_utils/_utils.py +++ b/src/stainless_commons_stripe/_utils/_utils.py @@ -86,8 +86,9 @@ def _extract_items( index += 1 if is_dict(obj): try: - # We are at the last entry in the path so we must remove the field - if (len(path)) == index: + # Remove the field if there are no more dict keys in the path, + # only "" traversal markers or end. + if all(p == "" for p in path[index:]): item = obj.pop(key) else: item = obj[key] diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py index ddd0f1e..106d67b 100644 --- a/tests/test_extract_files.py +++ b/tests/test_extract_files.py @@ -35,6 +35,15 @@ def test_multiple_files() -> None: assert query == {"documents": [{}, {}]} +def test_top_level_file_array() -> None: + query = {"files": [b"file one", b"file two"], "title": "hello"} + assert extract_files(query, paths=[["files", ""]]) == [ + ("files[]", b"file one"), + ("files[]", b"file two"), + ] + assert query == {"title": "hello"} + + @pytest.mark.parametrize( "query,paths,expected", [ From eed185a397e3447a11bdbb420aeacd04f7852b46 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 11 Apr 2026 05:31:57 +0000 Subject: [PATCH 32/41] docs: improve examples --- tests/api_resources/test_coupons.py | 4 +- tests/api_resources/test_customers.py | 84 ++------- tests/api_resources/test_disputes.py | 88 +-------- tests/api_resources/test_invoiceitems.py | 24 +-- tests/api_resources/test_invoices.py | 140 +++------------ tests/api_resources/test_payment_links.py | 48 ++--- tests/api_resources/test_refunds.py | 4 +- tests/api_resources/test_subscriptions.py | 210 ++++++---------------- 8 files changed, 126 insertions(+), 476 deletions(-) diff --git a/tests/api_resources/test_coupons.py b/tests/api_resources/test_coupons.py index 7d818da..82e418c 100644 --- a/tests/api_resources/test_coupons.py +++ b/tests/api_resources/test_coupons.py @@ -35,7 +35,7 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: duration_in_months=0, expand=["string"], max_redemptions=0, - metadata={"foo": "string"}, + metadata="", name="name", percent_off=0, redeem_by=0, @@ -126,7 +126,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> duration_in_months=0, expand=["string"], max_redemptions=0, - metadata={"foo": "string"}, + metadata="", name="name", percent_off=0, redeem_by=0, diff --git a/tests/api_resources/test_customers.py b/tests/api_resources/test_customers.py index 9853a47..f6974c6 100644 --- a/tests/api_resources/test_customers.py +++ b/tests/api_resources/test_customers.py @@ -26,57 +26,31 @@ def test_method_create(self, client: Stripe) -> None: @parametrize def test_method_create_with_all_params(self, client: Stripe) -> None: customer = client.customers.create( - address={ - "city": "city", - "country": "country", - "line1": "line1", - "line2": "line2", - "postal_code": "postal_code", - "state": "state", - }, + address="", balance=0, - business_name="string", + business_name="", cash_balance={"settings": {"reconciliation_mode": "automatic"}}, description="description", email="email", expand=["string"], - individual_name="string", + individual_name="", invoice_prefix="invoice_prefix", invoice_settings={ - "custom_fields": [ - { - "name": "name", - "value": "value", - } - ], + "custom_fields": "", "default_payment_method": "default_payment_method", "footer": "footer", - "rendering_options": { - "amount_tax_display": "", - "template": "template", - }, + "rendering_options": "", }, - metadata={"foo": "string"}, + metadata="", name="name", next_invoice_sequence=0, payment_method="payment_method", phone="phone", preferred_locales=["string"], - shipping={ - "address": { - "city": "city", - "country": "country", - "line1": "line1", - "line2": "line2", - "postal_code": "postal_code", - "state": "state", - }, - "name": "name", - "phone": "phone", - }, + shipping="", source="source", tax={ - "ip_address": "string", + "ip_address": "", "validate_location": "deferred", }, tax_exempt="", @@ -167,57 +141,31 @@ async def test_method_create(self, async_client: AsyncStripe) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> None: customer = await async_client.customers.create( - address={ - "city": "city", - "country": "country", - "line1": "line1", - "line2": "line2", - "postal_code": "postal_code", - "state": "state", - }, + address="", balance=0, - business_name="string", + business_name="", cash_balance={"settings": {"reconciliation_mode": "automatic"}}, description="description", email="email", expand=["string"], - individual_name="string", + individual_name="", invoice_prefix="invoice_prefix", invoice_settings={ - "custom_fields": [ - { - "name": "name", - "value": "value", - } - ], + "custom_fields": "", "default_payment_method": "default_payment_method", "footer": "footer", - "rendering_options": { - "amount_tax_display": "", - "template": "template", - }, + "rendering_options": "", }, - metadata={"foo": "string"}, + metadata="", name="name", next_invoice_sequence=0, payment_method="payment_method", phone="phone", preferred_locales=["string"], - shipping={ - "address": { - "city": "city", - "country": "country", - "line1": "line1", - "line2": "line2", - "postal_code": "postal_code", - "state": "state", - }, - "name": "name", - "phone": "phone", - }, + shipping="", source="source", tax={ - "ip_address": "string", + "ip_address": "", "validate_location": "deferred", }, tax_exempt="", diff --git a/tests/api_resources/test_disputes.py b/tests/api_resources/test_disputes.py index 720d8dc..0e935f5 100644 --- a/tests/api_resources/test_disputes.py +++ b/tests/api_resources/test_disputes.py @@ -43,47 +43,7 @@ def test_method_update_with_all_params(self, client: Stripe) -> None: "duplicate_charge_documentation": "duplicate_charge_documentation", "duplicate_charge_explanation": "duplicate_charge_explanation", "duplicate_charge_id": "duplicate_charge_id", - "enhanced_evidence": { - "visa_compelling_evidence_3": { - "disputed_transaction": { - "customer_account_id": "string", - "customer_device_fingerprint": "string", - "customer_device_id": "string", - "customer_email_address": "string", - "customer_purchase_ip": "string", - "merchandise_or_services": "merchandise", - "product_description": "string", - "shipping_address": { - "city": "string", - "country": "string", - "line1": "string", - "line2": "string", - "postal_code": "string", - "state": "string", - }, - }, - "prior_undisputed_transactions": [ - { - "charge": "charge", - "customer_account_id": "string", - "customer_device_fingerprint": "string", - "customer_device_id": "string", - "customer_email_address": "string", - "customer_purchase_ip": "string", - "product_description": "string", - "shipping_address": { - "city": "string", - "country": "string", - "line1": "string", - "line2": "string", - "postal_code": "string", - "state": "string", - }, - } - ], - }, - "visa_compliance": {"fee_acknowledged": True}, - }, + "enhanced_evidence": "", "product_description": "product_description", "receipt": "receipt", "refund_policy": "refund_policy", @@ -100,7 +60,7 @@ def test_method_update_with_all_params(self, client: Stripe) -> None: "uncategorized_text": "uncategorized_text", }, expand=["string"], - metadata={"foo": "string"}, + metadata="", submit=True, ) assert_matches_type(Dispute, dispute, path=["response"]) @@ -210,47 +170,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncStripe) -> "duplicate_charge_documentation": "duplicate_charge_documentation", "duplicate_charge_explanation": "duplicate_charge_explanation", "duplicate_charge_id": "duplicate_charge_id", - "enhanced_evidence": { - "visa_compelling_evidence_3": { - "disputed_transaction": { - "customer_account_id": "string", - "customer_device_fingerprint": "string", - "customer_device_id": "string", - "customer_email_address": "string", - "customer_purchase_ip": "string", - "merchandise_or_services": "merchandise", - "product_description": "string", - "shipping_address": { - "city": "string", - "country": "string", - "line1": "string", - "line2": "string", - "postal_code": "string", - "state": "string", - }, - }, - "prior_undisputed_transactions": [ - { - "charge": "charge", - "customer_account_id": "string", - "customer_device_fingerprint": "string", - "customer_device_id": "string", - "customer_email_address": "string", - "customer_purchase_ip": "string", - "product_description": "string", - "shipping_address": { - "city": "string", - "country": "string", - "line1": "string", - "line2": "string", - "postal_code": "string", - "state": "string", - }, - } - ], - }, - "visa_compliance": {"fee_acknowledged": True}, - }, + "enhanced_evidence": "", "product_description": "product_description", "receipt": "receipt", "refund_policy": "refund_policy", @@ -267,7 +187,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncStripe) -> "uncategorized_text": "uncategorized_text", }, expand=["string"], - metadata={"foo": "string"}, + metadata="", submit=True, ) assert_matches_type(Dispute, dispute, path=["response"]) diff --git a/tests/api_resources/test_invoiceitems.py b/tests/api_resources/test_invoiceitems.py index 90f1938..00f88b1 100644 --- a/tests/api_resources/test_invoiceitems.py +++ b/tests/api_resources/test_invoiceitems.py @@ -31,16 +31,10 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: customer_account="customer_account", description="description", discountable=True, - discounts=[ - { - "coupon": "coupon", - "discount": "discount", - "promotion_code": "promotion_code", - } - ], + discounts="", expand=["string"], invoice="invoice", - metadata={"foo": "string"}, + metadata="", period={ "end": 0, "start": 0, @@ -56,7 +50,7 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: quantity=0, subscription="subscription", tax_behavior="exclusive", - tax_code="string", + tax_code="", tax_rates=["string"], unit_amount_decimal="unit_amount_decimal", ) @@ -102,16 +96,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> customer_account="customer_account", description="description", discountable=True, - discounts=[ - { - "coupon": "coupon", - "discount": "discount", - "promotion_code": "promotion_code", - } - ], + discounts="", expand=["string"], invoice="invoice", - metadata={"foo": "string"}, + metadata="", period={ "end": 0, "start": 0, @@ -127,7 +115,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> quantity=0, subscription="subscription", tax_behavior="exclusive", - tax_code="string", + tax_code="", tax_rates=["string"], unit_amount_decimal="unit_amount_decimal", ) diff --git a/tests/api_resources/test_invoices.py b/tests/api_resources/test_invoices.py index 6469f5d..ee258ec 100644 --- a/tests/api_resources/test_invoices.py +++ b/tests/api_resources/test_invoices.py @@ -26,7 +26,7 @@ def test_method_create(self, client: Stripe) -> None: @parametrize def test_method_create_with_all_params(self, client: Stripe) -> None: invoice = client.invoices.create( - account_tax_ids=["string"], + account_tax_ids="", application_fee_amount=0, auto_advance=True, automatic_tax={ @@ -39,12 +39,7 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: automatically_finalizes_at=0, collection_method="charge_automatically", currency="currency", - custom_fields=[ - { - "name": "name", - "value": "value", - } - ], + custom_fields="", customer="customer", customer_account="customer_account", days_until_due=0, @@ -52,13 +47,7 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: default_source="default_source", default_tax_rates=["string"], description="description", - discounts=[ - { - "coupon": "coupon", - "discount": "discount", - "promotion_code": "promotion_code", - } - ], + discounts="", due_date=0, effective_at=0, expand=["string"], @@ -71,60 +60,29 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: "type": "account", "account": "account", }, - metadata={"foo": "string"}, + metadata="", number="number", on_behalf_of="on_behalf_of", payment_settings={ - "default_mandate": "string", + "default_mandate": "", "payment_method_options": { - "acss_debit": { - "mandate_options": {"transaction_type": "business"}, - "verification_method": "automatic", - }, - "bancontact": {"preferred_language": "de"}, - "card": { - "installments": { - "enabled": True, - "plan": { - "type": "bonus", - "count": 0, - "interval": "month", - }, - }, - "request_three_d_secure": "any", - }, - "customer_balance": { - "bank_transfer": { - "eu_bank_transfer": {"country": "country"}, - "type": "type", - }, - "funding_type": "funding_type", - }, + "acss_debit": "", + "bancontact": "", + "card": "", + "customer_balance": "", "konbini": "", - "payto": { - "mandate_options": { - "amount": 0, - "purpose": "dependant_support", - } - }, + "payto": "", "sepa_debit": "", - "us_bank_account": { - "financial_connections": { - "filters": {"account_subcategories": ["checking"]}, - "permissions": ["balances"], - "prefetch": ["balances"], - }, - "verification_method": "automatic", - }, + "us_bank_account": "", }, - "payment_method_types": ["ach_credit_transfer"], + "payment_method_types": "", }, pending_invoice_items_behavior="exclude", rendering={ "amount_tax_display": "", "pdf": {"page_size": "a4"}, "template": "template", - "template_version": 0, + "template_version": "", }, shipping_cost={ "shipping_rate": "shipping_rate", @@ -166,7 +124,7 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: "state": "state", }, "name": "name", - "phone": "string", + "phone": "", }, statement_descriptor="statement_descriptor", subscription="subscription", @@ -310,7 +268,7 @@ async def test_method_create(self, async_client: AsyncStripe) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> None: invoice = await async_client.invoices.create( - account_tax_ids=["string"], + account_tax_ids="", application_fee_amount=0, auto_advance=True, automatic_tax={ @@ -323,12 +281,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> automatically_finalizes_at=0, collection_method="charge_automatically", currency="currency", - custom_fields=[ - { - "name": "name", - "value": "value", - } - ], + custom_fields="", customer="customer", customer_account="customer_account", days_until_due=0, @@ -336,13 +289,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> default_source="default_source", default_tax_rates=["string"], description="description", - discounts=[ - { - "coupon": "coupon", - "discount": "discount", - "promotion_code": "promotion_code", - } - ], + discounts="", due_date=0, effective_at=0, expand=["string"], @@ -355,60 +302,29 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> "type": "account", "account": "account", }, - metadata={"foo": "string"}, + metadata="", number="number", on_behalf_of="on_behalf_of", payment_settings={ - "default_mandate": "string", + "default_mandate": "", "payment_method_options": { - "acss_debit": { - "mandate_options": {"transaction_type": "business"}, - "verification_method": "automatic", - }, - "bancontact": {"preferred_language": "de"}, - "card": { - "installments": { - "enabled": True, - "plan": { - "type": "bonus", - "count": 0, - "interval": "month", - }, - }, - "request_three_d_secure": "any", - }, - "customer_balance": { - "bank_transfer": { - "eu_bank_transfer": {"country": "country"}, - "type": "type", - }, - "funding_type": "funding_type", - }, + "acss_debit": "", + "bancontact": "", + "card": "", + "customer_balance": "", "konbini": "", - "payto": { - "mandate_options": { - "amount": 0, - "purpose": "dependant_support", - } - }, + "payto": "", "sepa_debit": "", - "us_bank_account": { - "financial_connections": { - "filters": {"account_subcategories": ["checking"]}, - "permissions": ["balances"], - "prefetch": ["balances"], - }, - "verification_method": "automatic", - }, + "us_bank_account": "", }, - "payment_method_types": ["ach_credit_transfer"], + "payment_method_types": "", }, pending_invoice_items_behavior="exclude", rendering={ "amount_tax_display": "", "pdf": {"page_size": "a4"}, "template": "template", - "template_version": 0, + "template_version": "", }, shipping_cost={ "shipping_rate": "shipping_rate", @@ -450,7 +366,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> "state": "state", }, "name": "name", - "phone": "string", + "phone": "", }, statement_descriptor="statement_descriptor", subscription="subscription", diff --git a/tests/api_resources/test_payment_links.py b/tests/api_resources/test_payment_links.py index 23811e5..7ae1676 100644 --- a/tests/api_resources/test_payment_links.py +++ b/tests/api_resources/test_payment_links.py @@ -110,10 +110,10 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: } ], custom_text={ - "after_submit": {"message": "message"}, - "shipping_address": {"message": "message"}, - "submit": {"message": "message"}, - "terms_of_service_acceptance": {"message": "message"}, + "after_submit": "", + "shipping_address": "", + "submit": "", + "terms_of_service_acceptance": "", }, customer_creation="always", expand=["string"], @@ -121,24 +121,16 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: invoice_creation={ "enabled": True, "invoice_data": { - "account_tax_ids": ["string"], - "custom_fields": [ - { - "name": "name", - "value": "value", - } - ], + "account_tax_ids": "", + "custom_fields": "", "description": "description", "footer": "footer", "issuer": { "type": "account", "account": "account", }, - "metadata": {"foo": "string"}, - "rendering_options": { - "amount_tax_display": "", - "template": "template", - }, + "metadata": "", + "rendering_options": "", }, }, metadata={"foo": "string"}, @@ -326,10 +318,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> } ], custom_text={ - "after_submit": {"message": "message"}, - "shipping_address": {"message": "message"}, - "submit": {"message": "message"}, - "terms_of_service_acceptance": {"message": "message"}, + "after_submit": "", + "shipping_address": "", + "submit": "", + "terms_of_service_acceptance": "", }, customer_creation="always", expand=["string"], @@ -337,24 +329,16 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> invoice_creation={ "enabled": True, "invoice_data": { - "account_tax_ids": ["string"], - "custom_fields": [ - { - "name": "name", - "value": "value", - } - ], + "account_tax_ids": "", + "custom_fields": "", "description": "description", "footer": "footer", "issuer": { "type": "account", "account": "account", }, - "metadata": {"foo": "string"}, - "rendering_options": { - "amount_tax_display": "", - "template": "template", - }, + "metadata": "", + "rendering_options": "", }, }, metadata={"foo": "string"}, diff --git a/tests/api_resources/test_refunds.py b/tests/api_resources/test_refunds.py index 025f578..a5734b0 100644 --- a/tests/api_resources/test_refunds.py +++ b/tests/api_resources/test_refunds.py @@ -31,7 +31,7 @@ def test_method_create_with_all_params(self, client: Stripe) -> None: customer="customer", expand=["string"], instructions_email="instructions_email", - metadata={"foo": "string"}, + metadata="", origin="customer_balance", payment_intent="payment_intent", reason="duplicate", @@ -80,7 +80,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> customer="customer", expand=["string"], instructions_email="instructions_email", - metadata={"foo": "string"}, + metadata="", origin="customer_balance", payment_intent="payment_intent", reason="duplicate", diff --git a/tests/api_resources/test_subscriptions.py b/tests/api_resources/test_subscriptions.py index 521f96b..6db9688 100644 --- a/tests/api_resources/test_subscriptions.py +++ b/tests/api_resources/test_subscriptions.py @@ -60,10 +60,10 @@ def test_method_update_with_all_params(self, client: Stripe) -> None: "unit_amount_decimal": "unit_amount_decimal", }, "quantity": 0, - "tax_rates": ["string"], + "tax_rates": "", } ], - application_fee_percent=0, + application_fee_percent="", automatic_tax={ "enabled": True, "liability": { @@ -72,32 +72,23 @@ def test_method_update_with_all_params(self, client: Stripe) -> None: }, }, billing_cycle_anchor="now", - billing_thresholds={ - "amount_gte": 0, - "reset_billing_cycle_anchor": True, - }, + billing_thresholds="", cancel_at="", cancel_at_period_end=True, cancellation_details={ - "comment": "string", + "comment": "", "feedback": "", }, collection_method="charge_automatically", days_until_due=0, default_payment_method="default_payment_method", - default_source="string", - default_tax_rates=["string"], - description="string", - discounts=[ - { - "coupon": "coupon", - "discount": "discount", - "promotion_code": "promotion_code", - } - ], + default_source="", + default_tax_rates="", + description="", + discounts="", expand=["string"], invoice_settings={ - "account_tax_ids": ["string"], + "account_tax_ids": "", "issuer": { "type": "account", "account": "account", @@ -106,17 +97,11 @@ def test_method_update_with_all_params(self, client: Stripe) -> None: items=[ { "id": "id", - "billing_thresholds": {"usage_gte": 0}, + "billing_thresholds": "", "clear_usage": True, "deleted": True, - "discounts": [ - { - "coupon": "coupon", - "discount": "discount", - "promotion_code": "promotion_code", - } - ], - "metadata": {"foo": "string"}, + "discounts": "", + "metadata": "", "price": "price", "price_data": { "currency": "currency", @@ -130,70 +115,32 @@ def test_method_update_with_all_params(self, client: Stripe) -> None: "unit_amount_decimal": "unit_amount_decimal", }, "quantity": 0, - "tax_rates": ["string"], + "tax_rates": "", } ], - metadata={"foo": "string"}, + metadata="", off_session=True, - on_behalf_of="string", - pause_collection={ - "behavior": "keep_as_draft", - "resumes_at": 0, - }, + on_behalf_of="", + pause_collection="", payment_behavior="allow_incomplete", payment_settings={ "payment_method_options": { - "acss_debit": { - "mandate_options": {"transaction_type": "business"}, - "verification_method": "automatic", - }, - "bancontact": {"preferred_language": "de"}, - "card": { - "mandate_options": { - "amount": 0, - "amount_type": "fixed", - "description": "description", - }, - "network": "amex", - "request_three_d_secure": "any", - }, - "customer_balance": { - "bank_transfer": { - "eu_bank_transfer": {"country": "country"}, - "type": "type", - }, - "funding_type": "funding_type", - }, + "acss_debit": "", + "bancontact": "", + "card": "", + "customer_balance": "", "konbini": "", - "payto": { - "mandate_options": { - "amount": 0, - "purpose": "dependant_support", - } - }, + "payto": "", "sepa_debit": "", - "us_bank_account": { - "financial_connections": { - "filters": {"account_subcategories": ["checking"]}, - "permissions": ["balances"], - "prefetch": ["balances"], - }, - "verification_method": "automatic", - }, + "us_bank_account": "", }, - "payment_method_types": ["ach_credit_transfer"], + "payment_method_types": "", "save_default_payment_method": "off", }, - pending_invoice_item_interval={ - "interval": "day", - "interval_count": 0, - }, + pending_invoice_item_interval="", proration_behavior="always_invoice", proration_date=0, - transfer_data={ - "destination": "destination", - "amount_percent": 0, - }, + transfer_data="", trial_end="now", trial_from_plan=True, trial_settings={"end_behavior": {"missing_payment_method": "cancel"}}, @@ -305,7 +252,7 @@ def test_method_cancel_with_all_params(self, client: Stripe) -> None: subscription = client.subscriptions.cancel( subscription_exposed_id="subscription_exposed_id", cancellation_details={ - "comment": "string", + "comment": "", "feedback": "", }, expand=["string"], @@ -393,10 +340,10 @@ async def test_method_update_with_all_params(self, async_client: AsyncStripe) -> "unit_amount_decimal": "unit_amount_decimal", }, "quantity": 0, - "tax_rates": ["string"], + "tax_rates": "", } ], - application_fee_percent=0, + application_fee_percent="", automatic_tax={ "enabled": True, "liability": { @@ -405,32 +352,23 @@ async def test_method_update_with_all_params(self, async_client: AsyncStripe) -> }, }, billing_cycle_anchor="now", - billing_thresholds={ - "amount_gte": 0, - "reset_billing_cycle_anchor": True, - }, + billing_thresholds="", cancel_at="", cancel_at_period_end=True, cancellation_details={ - "comment": "string", + "comment": "", "feedback": "", }, collection_method="charge_automatically", days_until_due=0, default_payment_method="default_payment_method", - default_source="string", - default_tax_rates=["string"], - description="string", - discounts=[ - { - "coupon": "coupon", - "discount": "discount", - "promotion_code": "promotion_code", - } - ], + default_source="", + default_tax_rates="", + description="", + discounts="", expand=["string"], invoice_settings={ - "account_tax_ids": ["string"], + "account_tax_ids": "", "issuer": { "type": "account", "account": "account", @@ -439,17 +377,11 @@ async def test_method_update_with_all_params(self, async_client: AsyncStripe) -> items=[ { "id": "id", - "billing_thresholds": {"usage_gte": 0}, + "billing_thresholds": "", "clear_usage": True, "deleted": True, - "discounts": [ - { - "coupon": "coupon", - "discount": "discount", - "promotion_code": "promotion_code", - } - ], - "metadata": {"foo": "string"}, + "discounts": "", + "metadata": "", "price": "price", "price_data": { "currency": "currency", @@ -463,70 +395,32 @@ async def test_method_update_with_all_params(self, async_client: AsyncStripe) -> "unit_amount_decimal": "unit_amount_decimal", }, "quantity": 0, - "tax_rates": ["string"], + "tax_rates": "", } ], - metadata={"foo": "string"}, + metadata="", off_session=True, - on_behalf_of="string", - pause_collection={ - "behavior": "keep_as_draft", - "resumes_at": 0, - }, + on_behalf_of="", + pause_collection="", payment_behavior="allow_incomplete", payment_settings={ "payment_method_options": { - "acss_debit": { - "mandate_options": {"transaction_type": "business"}, - "verification_method": "automatic", - }, - "bancontact": {"preferred_language": "de"}, - "card": { - "mandate_options": { - "amount": 0, - "amount_type": "fixed", - "description": "description", - }, - "network": "amex", - "request_three_d_secure": "any", - }, - "customer_balance": { - "bank_transfer": { - "eu_bank_transfer": {"country": "country"}, - "type": "type", - }, - "funding_type": "funding_type", - }, + "acss_debit": "", + "bancontact": "", + "card": "", + "customer_balance": "", "konbini": "", - "payto": { - "mandate_options": { - "amount": 0, - "purpose": "dependant_support", - } - }, + "payto": "", "sepa_debit": "", - "us_bank_account": { - "financial_connections": { - "filters": {"account_subcategories": ["checking"]}, - "permissions": ["balances"], - "prefetch": ["balances"], - }, - "verification_method": "automatic", - }, + "us_bank_account": "", }, - "payment_method_types": ["ach_credit_transfer"], + "payment_method_types": "", "save_default_payment_method": "off", }, - pending_invoice_item_interval={ - "interval": "day", - "interval_count": 0, - }, + pending_invoice_item_interval="", proration_behavior="always_invoice", proration_date=0, - transfer_data={ - "destination": "destination", - "amount_percent": 0, - }, + transfer_data="", trial_end="now", trial_from_plan=True, trial_settings={"end_behavior": {"missing_payment_method": "cancel"}}, @@ -638,7 +532,7 @@ async def test_method_cancel_with_all_params(self, async_client: AsyncStripe) -> subscription = await async_client.subscriptions.cancel( subscription_exposed_id="subscription_exposed_id", cancellation_details={ - "comment": "string", + "comment": "", "feedback": "", }, expand=["string"], From 17b695ecd0532acd0e19af3ee266ce3514a34a82 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 05:22:45 +0000 Subject: [PATCH 33/41] chore(internal): codegen related update --- scripts/mock | 6 +- scripts/test | 2 +- src/stainless_commons_stripe/_files.py | 56 ++++++++++- .../_utils/__init__.py | 1 - src/stainless_commons_stripe/_utils/_utils.py | 15 --- tests/test_deepcopy.py | 58 ----------- tests/test_files.py | 99 ++++++++++++++++++- 7 files changed, 155 insertions(+), 82 deletions(-) delete mode 100644 tests/test_deepcopy.py diff --git a/scripts/mock b/scripts/mock index 886f2ff..04d2901 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.20.2 -- steady --version + npm exec --package=@stdy/cli@0.22.1 -- steady --version - npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index b74e1b2..6ae607b 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.2 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.22.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 diff --git a/src/stainless_commons_stripe/_files.py b/src/stainless_commons_stripe/_files.py index cc14c14..0fdce17 100644 --- a/src/stainless_commons_stripe/_files.py +++ b/src/stainless_commons_stripe/_files.py @@ -3,8 +3,8 @@ import io import os import pathlib -from typing import overload -from typing_extensions import TypeGuard +from typing import Sequence, cast, overload +from typing_extensions import TypeVar, TypeGuard import anyio @@ -17,7 +17,9 @@ HttpxFileContent, HttpxRequestFiles, ) -from ._utils import is_tuple_t, is_mapping_t, is_sequence_t +from ._utils import is_list, is_mapping, is_tuple_t, is_mapping_t, is_sequence_t + +_T = TypeVar("_T") def is_base64_file_input(obj: object) -> TypeGuard[Base64FileInput]: @@ -121,3 +123,51 @@ async def async_read_file_content(file: FileContent) -> HttpxFileContent: return await anyio.Path(file).read_bytes() return file + + +def deepcopy_with_paths(item: _T, paths: Sequence[Sequence[str]]) -> _T: + """Copy only the containers along the given paths. + + Used to guard against mutation by extract_files without copying the entire structure. + Only dicts and lists that lie on a path are copied; everything else + is returned by reference. + + For example, given paths=[["foo", "files", "file"]] and the structure: + { + "foo": { + "bar": {"baz": {}}, + "files": {"file": } + } + } + The root dict, "foo", and "files" are copied (they lie on the path). + "bar" and "baz" are returned by reference (off the path). + """ + return _deepcopy_with_paths(item, paths, 0) + + +def _deepcopy_with_paths(item: _T, paths: Sequence[Sequence[str]], index: int) -> _T: + if not paths: + return item + if is_mapping(item): + key_to_paths: dict[str, list[Sequence[str]]] = {} + for path in paths: + if index < len(path): + key_to_paths.setdefault(path[index], []).append(path) + + # if no path continues through this mapping, it won't be mutated and copying it is redundant + if not key_to_paths: + return item + + result = dict(item) + for key, subpaths in key_to_paths.items(): + if key in result: + result[key] = _deepcopy_with_paths(result[key], subpaths, index + 1) + return cast(_T, result) + if is_list(item): + array_paths = [path for path in paths if index < len(path) and path[index] == ""] + + # if no path expects a list here, nothing will be mutated inside it - return by reference + if not array_paths: + return cast(_T, item) + return cast(_T, [_deepcopy_with_paths(entry, array_paths, index + 1) for entry in item]) + return item diff --git a/src/stainless_commons_stripe/_utils/__init__.py b/src/stainless_commons_stripe/_utils/__init__.py index 10cb66d..1c090e5 100644 --- a/src/stainless_commons_stripe/_utils/__init__.py +++ b/src/stainless_commons_stripe/_utils/__init__.py @@ -24,7 +24,6 @@ coerce_integer as coerce_integer, file_from_path as file_from_path, strip_not_given as strip_not_given, - deepcopy_minimal as deepcopy_minimal, get_async_library as get_async_library, maybe_coerce_float as maybe_coerce_float, get_required_header as get_required_header, diff --git a/src/stainless_commons_stripe/_utils/_utils.py b/src/stainless_commons_stripe/_utils/_utils.py index 63b8cd6..771859f 100644 --- a/src/stainless_commons_stripe/_utils/_utils.py +++ b/src/stainless_commons_stripe/_utils/_utils.py @@ -177,21 +177,6 @@ def is_iterable(obj: object) -> TypeGuard[Iterable[object]]: return isinstance(obj, Iterable) -def deepcopy_minimal(item: _T) -> _T: - """Minimal reimplementation of copy.deepcopy() that will only copy certain object types: - - - mappings, e.g. `dict` - - list - - This is done for performance reasons. - """ - if is_mapping(item): - return cast(_T, {k: deepcopy_minimal(v) for k, v in item.items()}) - if is_list(item): - return cast(_T, [deepcopy_minimal(entry) for entry in item]) - return item - - # copied from https://github.com/Rapptz/RoboDanny def human_join(seq: Sequence[str], *, delim: str = ", ", final: str = "or") -> str: size = len(seq) diff --git a/tests/test_deepcopy.py b/tests/test_deepcopy.py deleted file mode 100644 index e58bc31..0000000 --- a/tests/test_deepcopy.py +++ /dev/null @@ -1,58 +0,0 @@ -from stainless_commons_stripe._utils import deepcopy_minimal - - -def assert_different_identities(obj1: object, obj2: object) -> None: - assert obj1 == obj2 - assert id(obj1) != id(obj2) - - -def test_simple_dict() -> None: - obj1 = {"foo": "bar"} - obj2 = deepcopy_minimal(obj1) - assert_different_identities(obj1, obj2) - - -def test_nested_dict() -> None: - obj1 = {"foo": {"bar": True}} - obj2 = deepcopy_minimal(obj1) - assert_different_identities(obj1, obj2) - assert_different_identities(obj1["foo"], obj2["foo"]) - - -def test_complex_nested_dict() -> None: - obj1 = {"foo": {"bar": [{"hello": "world"}]}} - obj2 = deepcopy_minimal(obj1) - assert_different_identities(obj1, obj2) - assert_different_identities(obj1["foo"], obj2["foo"]) - assert_different_identities(obj1["foo"]["bar"], obj2["foo"]["bar"]) - assert_different_identities(obj1["foo"]["bar"][0], obj2["foo"]["bar"][0]) - - -def test_simple_list() -> None: - obj1 = ["a", "b", "c"] - obj2 = deepcopy_minimal(obj1) - assert_different_identities(obj1, obj2) - - -def test_nested_list() -> None: - obj1 = ["a", [1, 2, 3]] - obj2 = deepcopy_minimal(obj1) - assert_different_identities(obj1, obj2) - assert_different_identities(obj1[1], obj2[1]) - - -class MyObject: ... - - -def test_ignores_other_types() -> None: - # custom classes - my_obj = MyObject() - obj1 = {"foo": my_obj} - obj2 = deepcopy_minimal(obj1) - assert_different_identities(obj1, obj2) - assert obj1["foo"] is my_obj - - # tuples - obj3 = ("a", "b") - obj4 = deepcopy_minimal(obj3) - assert obj3 is obj4 diff --git a/tests/test_files.py b/tests/test_files.py index 441d3fc..e7d07b3 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -4,7 +4,8 @@ import pytest from dirty_equals import IsDict, IsList, IsBytes, IsTuple -from stainless_commons_stripe._files import to_httpx_files, async_to_httpx_files +from stainless_commons_stripe._files import to_httpx_files, deepcopy_with_paths, async_to_httpx_files +from stainless_commons_stripe._utils import extract_files readme_path = Path(__file__).parent.parent.joinpath("README.md") @@ -49,3 +50,99 @@ def test_string_not_allowed() -> None: "file": "foo", # type: ignore } ) + + +def assert_different_identities(obj1: object, obj2: object) -> None: + assert obj1 == obj2 + assert obj1 is not obj2 + + +class TestDeepcopyWithPaths: + def test_copies_top_level_dict(self) -> None: + original = {"file": b"data", "other": "value"} + result = deepcopy_with_paths(original, [["file"]]) + assert_different_identities(result, original) + + def test_file_value_is_same_reference(self) -> None: + file_bytes = b"contents" + original = {"file": file_bytes} + result = deepcopy_with_paths(original, [["file"]]) + assert_different_identities(result, original) + assert result["file"] is file_bytes + + def test_list_popped_wholesale(self) -> None: + files = [b"f1", b"f2"] + original = {"files": files, "title": "t"} + result = deepcopy_with_paths(original, [["files", ""]]) + assert_different_identities(result, original) + result_files = result["files"] + assert isinstance(result_files, list) + assert_different_identities(result_files, files) + + def test_nested_array_path_copies_list_and_elements(self) -> None: + elem1 = {"file": b"f1", "extra": 1} + elem2 = {"file": b"f2", "extra": 2} + original = {"items": [elem1, elem2]} + result = deepcopy_with_paths(original, [["items", "", "file"]]) + assert_different_identities(result, original) + result_items = result["items"] + assert isinstance(result_items, list) + assert_different_identities(result_items, original["items"]) + assert_different_identities(result_items[0], elem1) + assert_different_identities(result_items[1], elem2) + + def test_empty_paths_returns_same_object(self) -> None: + original = {"foo": "bar"} + result = deepcopy_with_paths(original, []) + assert result is original + + def test_multiple_paths(self) -> None: + f1 = b"file1" + f2 = b"file2" + original = {"a": f1, "b": f2, "c": "unchanged"} + result = deepcopy_with_paths(original, [["a"], ["b"]]) + assert_different_identities(result, original) + assert result["a"] is f1 + assert result["b"] is f2 + assert result["c"] is original["c"] + + def test_extract_files_does_not_mutate_original_top_level(self) -> None: + file_bytes = b"contents" + original = {"file": file_bytes, "other": "value"} + + copied = deepcopy_with_paths(original, [["file"]]) + extracted = extract_files(copied, paths=[["file"]]) + + assert extracted == [("file", file_bytes)] + assert original == {"file": file_bytes, "other": "value"} + assert copied == {"other": "value"} + + def test_extract_files_does_not_mutate_original_nested_array_path(self) -> None: + file1 = b"f1" + file2 = b"f2" + original = { + "items": [ + {"file": file1, "extra": 1}, + {"file": file2, "extra": 2}, + ], + "title": "example", + } + + copied = deepcopy_with_paths(original, [["items", "", "file"]]) + extracted = extract_files(copied, paths=[["items", "", "file"]]) + + assert extracted == [("items[][file]", file1), ("items[][file]", file2)] + assert original == { + "items": [ + {"file": file1, "extra": 1}, + {"file": file2, "extra": 2}, + ], + "title": "example", + } + assert copied == { + "items": [ + {"extra": 1}, + {"extra": 2}, + ], + "title": "example", + } From 65ba06e655539c6bf8d41449fc8516417848ba97 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Apr 2026 03:09:51 +0000 Subject: [PATCH 34/41] chore(internal): codegen related update --- scripts/bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/bootstrap b/scripts/bootstrap index 4638ec6..5a23841 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { echo -n "==> Install Homebrew dependencies? (y/N): " read -r response From 32491ca9d2543d11b3dc90c0904cab9ab77cc462 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 03:20:06 +0000 Subject: [PATCH 35/41] chore(internal): codegen related update --- src/stainless_commons_stripe/_client.py | 24 ++++++++++- src/stainless_commons_stripe/_qs.py | 8 +--- src/stainless_commons_stripe/_types.py | 3 ++ src/stainless_commons_stripe/_utils/_utils.py | 42 +++++++++++++++---- tests/test_extract_files.py | 28 ++++++++++--- tests/test_files.py | 2 +- 6 files changed, 86 insertions(+), 21 deletions(-) diff --git a/src/stainless_commons_stripe/_client.py b/src/stainless_commons_stripe/_client.py index 5d1d51f..af0f30e 100644 --- a/src/stainless_commons_stripe/_client.py +++ b/src/stainless_commons_stripe/_client.py @@ -20,7 +20,11 @@ RequestOptions, not_given, ) -from ._utils import is_given, get_async_library +from ._utils import ( + is_given, + is_mapping_t, + get_async_library, +) from ._compat import cached_property from ._models import SecurityOptions from ._version import __version__ @@ -105,6 +109,15 @@ def __init__( if base_url is None: base_url = f"https://api.stripe.com/" + custom_headers_env = os.environ.get("STRIPE_CUSTOM_HEADERS") + if custom_headers_env is not None: + parsed: dict[str, str] = {} + for line in custom_headers_env.split("\n"): + colon = line.find(":") + if colon >= 0: + parsed[line[:colon].strip()] = line[colon + 1 :].strip() + default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})} + super().__init__( version=__version__, base_url=base_url, @@ -363,6 +376,15 @@ def __init__( if base_url is None: base_url = f"https://api.stripe.com/" + custom_headers_env = os.environ.get("STRIPE_CUSTOM_HEADERS") + if custom_headers_env is not None: + parsed: dict[str, str] = {} + for line in custom_headers_env.split("\n"): + colon = line.find(":") + if colon >= 0: + parsed[line[:colon].strip()] = line[colon + 1 :].strip() + default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})} + super().__init__( version=__version__, base_url=base_url, diff --git a/src/stainless_commons_stripe/_qs.py b/src/stainless_commons_stripe/_qs.py index de8c99b..4127c19 100644 --- a/src/stainless_commons_stripe/_qs.py +++ b/src/stainless_commons_stripe/_qs.py @@ -2,17 +2,13 @@ from typing import Any, List, Tuple, Union, Mapping, TypeVar from urllib.parse import parse_qs, urlencode -from typing_extensions import Literal, get_args +from typing_extensions import get_args -from ._types import NotGiven, not_given +from ._types import NotGiven, ArrayFormat, NestedFormat, not_given from ._utils import flatten _T = TypeVar("_T") - -ArrayFormat = Literal["comma", "repeat", "indices", "brackets"] -NestedFormat = Literal["dots", "brackets"] - PrimitiveData = Union[str, int, float, bool, None] # this should be Data = Union[PrimitiveData, "List[Data]", "Tuple[Data]", "Mapping[str, Data]"] # https://github.com/microsoft/pyright/issues/3555 diff --git a/src/stainless_commons_stripe/_types.py b/src/stainless_commons_stripe/_types.py index fea0825..5bb65d2 100644 --- a/src/stainless_commons_stripe/_types.py +++ b/src/stainless_commons_stripe/_types.py @@ -47,6 +47,9 @@ ModelT = TypeVar("ModelT", bound=pydantic.BaseModel) _T = TypeVar("_T") +ArrayFormat = Literal["comma", "repeat", "indices", "brackets"] +NestedFormat = Literal["dots", "brackets"] + # Approximates httpx internal ProxiesTypes and RequestFiles types # while adding support for `PathLike` instances diff --git a/src/stainless_commons_stripe/_utils/_utils.py b/src/stainless_commons_stripe/_utils/_utils.py index 771859f..199cd23 100644 --- a/src/stainless_commons_stripe/_utils/_utils.py +++ b/src/stainless_commons_stripe/_utils/_utils.py @@ -17,11 +17,11 @@ ) from pathlib import Path from datetime import date, datetime -from typing_extensions import TypeGuard +from typing_extensions import TypeGuard, get_args import sniffio -from .._types import Omit, NotGiven, FileTypes, HeadersLike +from .._types import Omit, NotGiven, FileTypes, ArrayFormat, HeadersLike _T = TypeVar("_T") _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...]) @@ -40,25 +40,45 @@ def extract_files( query: Mapping[str, object], *, paths: Sequence[Sequence[str]], + array_format: ArrayFormat = "brackets", ) -> list[tuple[str, FileTypes]]: """Recursively extract files from the given dictionary based on specified paths. A path may look like this ['foo', 'files', '', 'data']. + ``array_format`` controls how ```` segments contribute to the emitted + field name. Supported values: ``"brackets"`` (``foo[]``), ``"repeat"`` and + ``"comma"`` (``foo``), ``"indices"`` (``foo[0]``, ``foo[1]``). + Note: this mutates the given dictionary. """ files: list[tuple[str, FileTypes]] = [] for path in paths: - files.extend(_extract_items(query, path, index=0, flattened_key=None)) + files.extend(_extract_items(query, path, index=0, flattened_key=None, array_format=array_format)) return files +def _array_suffix(array_format: ArrayFormat, array_index: int) -> str: + if array_format == "brackets": + return "[]" + if array_format == "indices": + return f"[{array_index}]" + if array_format == "repeat" or array_format == "comma": + # Both repeat the bare field name for each file part; there is no + # meaningful way to comma-join binary parts. + return "" + raise NotImplementedError( + f"Unknown array_format value: {array_format}, choose from {', '.join(get_args(ArrayFormat))}" + ) + + def _extract_items( obj: object, path: Sequence[str], *, index: int, flattened_key: str | None, + array_format: ArrayFormat, ) -> list[tuple[str, FileTypes]]: try: key = path[index] @@ -75,9 +95,11 @@ def _extract_items( if is_list(obj): files: list[tuple[str, FileTypes]] = [] - for entry in obj: - assert_is_file_content(entry, key=flattened_key + "[]" if flattened_key else "") - files.append((flattened_key + "[]", cast(FileTypes, entry))) + for array_index, entry in enumerate(obj): + suffix = _array_suffix(array_format, array_index) + emitted_key = (flattened_key + suffix) if flattened_key else suffix + assert_is_file_content(entry, key=emitted_key) + files.append((emitted_key, cast(FileTypes, entry))) return files assert_is_file_content(obj, key=flattened_key) @@ -106,6 +128,7 @@ def _extract_items( path, index=index, flattened_key=flattened_key, + array_format=array_format, ) elif is_list(obj): if key != "": @@ -117,9 +140,12 @@ def _extract_items( item, path, index=index, - flattened_key=flattened_key + "[]" if flattened_key is not None else "[]", + flattened_key=( + (flattened_key if flattened_key is not None else "") + _array_suffix(array_format, array_index) + ), + array_format=array_format, ) - for item in obj + for array_index, item in enumerate(obj) ] ) diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py index 106d67b..fe4f3dd 100644 --- a/tests/test_extract_files.py +++ b/tests/test_extract_files.py @@ -4,7 +4,7 @@ import pytest -from stainless_commons_stripe._types import FileTypes +from stainless_commons_stripe._types import FileTypes, ArrayFormat from stainless_commons_stripe._utils import extract_files @@ -37,10 +37,7 @@ def test_multiple_files() -> None: def test_top_level_file_array() -> None: query = {"files": [b"file one", b"file two"], "title": "hello"} - assert extract_files(query, paths=[["files", ""]]) == [ - ("files[]", b"file one"), - ("files[]", b"file two"), - ] + assert extract_files(query, paths=[["files", ""]]) == [("files[]", b"file one"), ("files[]", b"file two")] assert query == {"title": "hello"} @@ -71,3 +68,24 @@ def test_ignores_incorrect_paths( expected: list[tuple[str, FileTypes]], ) -> None: assert extract_files(query, paths=paths) == expected + + +@pytest.mark.parametrize( + "array_format,expected_top_level,expected_nested", + [ + ("brackets", [("files[]", b"a"), ("files[]", b"b")], [("items[][file]", b"a"), ("items[][file]", b"b")]), + ("repeat", [("files", b"a"), ("files", b"b")], [("items[file]", b"a"), ("items[file]", b"b")]), + ("comma", [("files", b"a"), ("files", b"b")], [("items[file]", b"a"), ("items[file]", b"b")]), + ("indices", [("files[0]", b"a"), ("files[1]", b"b")], [("items[0][file]", b"a"), ("items[1][file]", b"b")]), + ], +) +def test_array_format_controls_file_field_names( + array_format: ArrayFormat, + expected_top_level: list[tuple[str, FileTypes]], + expected_nested: list[tuple[str, FileTypes]], +) -> None: + top_level = {"files": [b"a", b"b"]} + assert extract_files(top_level, paths=[["files", ""]], array_format=array_format) == expected_top_level + + nested = {"items": [{"file": b"a"}, {"file": b"b"}]} + assert extract_files(nested, paths=[["items", "", "file"]], array_format=array_format) == expected_nested diff --git a/tests/test_files.py b/tests/test_files.py index e7d07b3..2bcdb69 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -131,7 +131,7 @@ def test_extract_files_does_not_mutate_original_nested_array_path(self) -> None: copied = deepcopy_with_paths(original, [["items", "", "file"]]) extracted = extract_files(copied, paths=[["items", "", "file"]]) - assert extracted == [("items[][file]", file1), ("items[][file]", file2)] + assert [entry for _, entry in extracted] == [file1, file2] assert original == { "items": [ {"file": file1, "extra": 1}, From 27298e27d080539cd9a7a8c6d5e5a0c4241922aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 04:56:03 +0000 Subject: [PATCH 36/41] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 69ddc11..9a49b72 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless-commons%2Fstripe-minimal-d7db5d2f2f83e89d00e8529a1b6d4ed4746bd306d0e6ffba02f321b576dcc340.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless-commons/stripe-minimal-d7db5d2f2f83e89d00e8529a1b6d4ed4746bd306d0e6ffba02f321b576dcc340.yml openapi_spec_hash: e09fbe83a958ffba517bce207e9f9dc1 config_hash: 59158dbcf8534e76accb613919408cdb From 7d3763eadb0a7fb5e58371592ebade2472ba8c3a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 03:52:15 +0000 Subject: [PATCH 37/41] chore(internal): codegen related update --- .stats.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9a49b72..b060935 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless-commons/stripe-minimal-d7db5d2f2f83e89d00e8529a1b6d4ed4746bd306d0e6ffba02f321b576dcc340.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless-commons/stripe-minimal-873073cd1fb4cdd778649b19fd32d07c569b855f5db09a527626e51a479c3c3e.yml openapi_spec_hash: e09fbe83a958ffba517bce207e9f9dc1 config_hash: 59158dbcf8534e76accb613919408cdb diff --git a/pyproject.toml b/pyproject.toml index cfc1218..f4b0130 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -154,7 +154,7 @@ show_error_codes = true # # We also exclude our `tests` as mypy doesn't always infer # types correctly and Pyright will still catch any type errors. -exclude = ['src/stainless_commons_stripe/_files.py', '_dev/.*.py', 'tests/.*'] +exclude = ["src/stainless_commons_stripe/_files.py", "_dev/.*.py", "tests/.*"] strict_equality = true implicit_reexport = true From a665c40437d9b383bd5c015f675153c5b876517e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 May 2026 03:23:59 +0000 Subject: [PATCH 38/41] chore(internal): codegen related update --- src/stainless_commons_stripe/_files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stainless_commons_stripe/_files.py b/src/stainless_commons_stripe/_files.py index 0fdce17..76da9e0 100644 --- a/src/stainless_commons_stripe/_files.py +++ b/src/stainless_commons_stripe/_files.py @@ -99,7 +99,7 @@ async def async_to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles elif is_sequence_t(files): files = [(key, await _async_transform_file(file)) for key, file in files] else: - raise TypeError("Unexpected file type input {type(files)}, expected mapping or sequence") + raise TypeError(f"Unexpected file type input {type(files)}, expected mapping or sequence") return files From 25caceb60320734674a5a333109d427eb0b9fec9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 03:15:36 +0000 Subject: [PATCH 39/41] chore(internal): codegen related update --- src/stainless_commons_stripe/_models.py | 80 +++++++++++++++++++++++++ tests/test_models.py | 60 ++++++++++++++++++- 2 files changed, 137 insertions(+), 3 deletions(-) diff --git a/src/stainless_commons_stripe/_models.py b/src/stainless_commons_stripe/_models.py index e22dd2a..69f41a6 100644 --- a/src/stainless_commons_stripe/_models.py +++ b/src/stainless_commons_stripe/_models.py @@ -25,7 +25,9 @@ ClassVar, Protocol, Required, + Annotated, ParamSpec, + TypeAlias, TypedDict, TypeGuard, final, @@ -79,7 +81,15 @@ from ._constants import RAW_RESPONSE_HEADER if TYPE_CHECKING: + from pydantic import GetCoreSchemaHandler, ValidatorFunctionWrapHandler + from pydantic_core import CoreSchema, core_schema from pydantic_core.core_schema import ModelField, ModelSchema, LiteralSchema, ModelFieldsSchema +else: + try: + from pydantic_core import CoreSchema, core_schema + except ImportError: + CoreSchema = None + core_schema = None __all__ = ["BaseModel", "GenericModel"] @@ -396,6 +406,76 @@ def model_dump_json( ) +class _EagerIterable(list[_T], Generic[_T]): + """ + Accepts any Iterable[T] input (including generators), consumes it + eagerly, and validates all items upfront. + + Validation preserves the original container type where possible + (e.g. a set[T] stays a set[T]). Serialization (model_dump / JSON) + always emits a list — round-tripping through model_dump() will not + restore the original container type. + """ + + @classmethod + def __get_pydantic_core_schema__( + cls, + source_type: Any, + handler: GetCoreSchemaHandler, + ) -> CoreSchema: + (item_type,) = get_args(source_type) or (Any,) + item_schema: CoreSchema = handler.generate_schema(item_type) + list_of_items_schema: CoreSchema = core_schema.list_schema(item_schema) + + return core_schema.no_info_wrap_validator_function( + cls._validate, + list_of_items_schema, + serialization=core_schema.plain_serializer_function_ser_schema( + cls._serialize, + info_arg=False, + ), + ) + + @staticmethod + def _validate(v: Iterable[_T], handler: "ValidatorFunctionWrapHandler") -> Any: + original_type: type[Any] = type(v) + + # Normalize to list so list_schema can validate each item + if isinstance(v, list): + items: list[_T] = v + else: + try: + items = list(v) + except TypeError as e: + raise TypeError("Value is not iterable") from e + + # Validate items against the inner schema + validated: list[_T] = handler(items) + + # Reconstruct original container type + if original_type is list: + return validated + # str(list) produces the list's repr, not a string built from items, + # so skip reconstruction for str and its subclasses. + if issubclass(original_type, str): + return validated + try: + return original_type(validated) + except (TypeError, ValueError): + # If the type cannot be reconstructed, just return the validated list + return validated + + @staticmethod + def _serialize(v: Iterable[_T]) -> list[_T]: + """Always serialize as a list so Pydantic's JSON encoder is happy.""" + if isinstance(v, list): + return v + return list(v) + + +EagerIterable: TypeAlias = Annotated[Iterable[_T], _EagerIterable] + + def _construct_field(value: object, field: FieldInfo, key: str) -> object: if value is None: return field_get_default(field) diff --git a/tests/test_models.py b/tests/test_models.py index a1c82fd..125c928 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,7 +1,8 @@ import json -from typing import TYPE_CHECKING, Any, Dict, List, Union, Optional, cast +from typing import TYPE_CHECKING, Any, Dict, List, Union, Iterable, Optional, cast from datetime import datetime, timezone -from typing_extensions import Literal, Annotated, TypeAliasType +from collections import deque +from typing_extensions import Literal, Annotated, TypedDict, TypeAliasType import pytest import pydantic @@ -9,7 +10,7 @@ from stainless_commons_stripe._utils import PropertyInfo from stainless_commons_stripe._compat import PYDANTIC_V1, parse_obj, model_dump, model_json -from stainless_commons_stripe._models import DISCRIMINATOR_CACHE, BaseModel, construct_type +from stainless_commons_stripe._models import DISCRIMINATOR_CACHE, BaseModel, EagerIterable, construct_type class BasicModel(BaseModel): @@ -961,3 +962,56 @@ def __getattr__(self, attr: str) -> Item: ... assert model.a.prop == 1 assert isinstance(model.a, Item) assert model.other == "foo" + + +# NOTE: Workaround for Pydantic Iterable behavior. +# Iterable fields are replaced with a ValidatorIterator and may be consumed +# during serialization, which can cause subsequent dumps to return empty data. +# See: https://github.com/pydantic/pydantic/issues/9541 +@pytest.mark.parametrize( + "data, expected_validated", + [ + ([1, 2, 3], [1, 2, 3]), + ((1, 2, 3), (1, 2, 3)), + (set([1, 2, 3]), set([1, 2, 3])), + (iter([1, 2, 3]), [1, 2, 3]), + ([], []), + ((x for x in [1, 2, 3]), [1, 2, 3]), + (map(lambda x: x, [1, 2, 3]), [1, 2, 3]), + (frozenset([1, 2, 3]), frozenset([1, 2, 3])), + (deque([1, 2, 3]), deque([1, 2, 3])), + ], + ids=["list", "tuple", "set", "iterator", "empty", "generator", "map", "frozenset", "deque"], +) +@pytest.mark.skipif(PYDANTIC_V1, reason="this is only supported in pydantic v2") +def test_iterable_construction(data: Iterable[int], expected_validated: Iterable[int]) -> None: + class TypeWithIterable(TypedDict): + items: EagerIterable[int] + + class Model(BaseModel): + data: TypeWithIterable + + m = Model.model_validate({"data": {"items": data}}) + assert m.data["items"] == expected_validated + + # Verify repeated dumps don't lose data (the original bug) + assert m.model_dump()["data"]["items"] == list(expected_validated) + assert m.model_dump()["data"]["items"] == list(expected_validated) + + +@pytest.mark.skipif(PYDANTIC_V1, reason="this is only supported in pydantic v2") +def test_iterable_construction_str_falls_back_to_list() -> None: + # str is iterable (over chars), but str(list_of_chars) produces the list's repr + # rather than reconstructing a string from items. We special-case str to fall + # back to list instead of attempting reconstruction. + class TypeWithIterable(TypedDict): + items: EagerIterable[str] + + class Model(BaseModel): + data: TypeWithIterable + + m = Model.model_validate({"data": {"items": "hello"}}) + + # falls back to list of chars rather than calling str(["h", "e", "l", "l", "o"]) + assert m.data["items"] == ["h", "e", "l", "l", "o"] + assert m.model_dump()["data"]["items"] == ["h", "e", "l", "l", "o"] From 7281455bf015da226d3dc5ecd9373924d779716a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 May 2026 02:43:28 +0000 Subject: [PATCH 40/41] chore(internal): codegen related update --- .github/workflows/ci.yml | 14 +++++++------- .github/workflows/publish-pypi.yml | 4 ++-- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8718d05..b03f70e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,10 +21,10 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/stripe-minimal-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Install uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 with: version: '0.10.2' @@ -43,10 +43,10 @@ jobs: id-token: write runs-on: ${{ github.repository == 'stainless-sdks/stripe-minimal-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Install uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 with: version: '0.10.2' @@ -61,7 +61,7 @@ jobs: github.repository == 'stainless-sdks/stripe-minimal-python' && !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: core.setOutput('github_token', await core.getIDToken()); @@ -81,10 +81,10 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/stripe-minimal-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Install uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 with: version: '0.10.2' diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 697f517..96d95e4 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Install uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 with: version: '0.9.13' diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index a6216c4..ca702fa 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'stainless-commons/stripe-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Check release environment run: | From bbaa94a7514b6250ab0fb87c584fc8b9136ad89e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 May 2026 03:30:39 +0000 Subject: [PATCH 41/41] release: 0.2.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 58 ++++++++++++++++++++++++ pyproject.toml | 2 +- src/stainless_commons_stripe/_version.py | 2 +- 4 files changed, 61 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3d2ac0b..10f3091 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0" + ".": "0.2.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e30dc9..691b714 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,63 @@ # Changelog +## 0.2.0 (2026-05-13) + +Full Changelog: [v0.1.0...v0.2.0](https://github.com/stainless-commons/stripe-python/compare/v0.1.0...v0.2.0) + +### Features + +* **internal:** implement indices array format for query and form serialization ([17ab3f3](https://github.com/stainless-commons/stripe-python/commit/17ab3f3c1d2dadb6f357a9e61df025bd4ee0129a)) + + +### Bug Fixes + +* **client:** preserve hardcoded query params when merging with user params ([fb89f44](https://github.com/stainless-commons/stripe-python/commit/fb89f44fe38a01b3fd386ea71c2db9b26a5963dc)) +* **deps:** bump minimum typing-extensions version ([a345ecd](https://github.com/stainless-commons/stripe-python/commit/a345ecd2ac41ef6d61458b205ed98319a524f0c8)) +* ensure file data are only sent as 1 parameter ([9099ed6](https://github.com/stainless-commons/stripe-python/commit/9099ed6e7425449bf0e0579f53b6ea141787d3f2)) +* **pydantic:** do not pass `by_alias` unless set ([0449b45](https://github.com/stainless-commons/stripe-python/commit/0449b453ecc7f71d93c2e027a20d452ad3ab7c87)) +* sanitize endpoint path params ([35bfff2](https://github.com/stainless-commons/stripe-python/commit/35bfff2629faeada215bcd5ec87892295d9ee500)) +* use correct format for nested and array query params ([aed61b7](https://github.com/stainless-commons/stripe-python/commit/aed61b71afd19864976d3202e6d2b48cadae2ee8)) + + +### Chores + +* bump @stdy/cli to 0.15.3 ([3847ce1](https://github.com/stainless-commons/stripe-python/commit/3847ce1c5966a6ec456b3c831c7b275f37c17b34)) +* **ci:** bump uv version ([e3f69aa](https://github.com/stainless-commons/stripe-python/commit/e3f69aac9b1c86932148e536fff17919224e4b3d)) +* **ci:** skip lint on metadata-only changes ([d93c7cf](https://github.com/stainless-commons/stripe-python/commit/d93c7cffbc6b2219bd7daefe997c900fea976fdc)) +* **ci:** skip uploading artifacts on stainless-internal branches ([3cd3725](https://github.com/stainless-commons/stripe-python/commit/3cd37254e2c8d4f81525c91263b6d76ce234250a)) +* format all `api.md` files ([c48c11d](https://github.com/stainless-commons/stripe-python/commit/c48c11d7ded34e0caebe970203291c68ba9552fb)) +* **internal:** add request options to SSE classes ([fa41519](https://github.com/stainless-commons/stripe-python/commit/fa41519a4d2313962ac322d782d1f70265b6d0ba)) +* **internal:** bump mock server version ([44e6bfb](https://github.com/stainless-commons/stripe-python/commit/44e6bfb11bb60d74b96418f93dad036d5e286d71)) +* **internal:** codegen related update ([7281455](https://github.com/stainless-commons/stripe-python/commit/7281455bf015da226d3dc5ecd9373924d779716a)) +* **internal:** codegen related update ([25caceb](https://github.com/stainless-commons/stripe-python/commit/25caceb60320734674a5a333109d427eb0b9fec9)) +* **internal:** codegen related update ([a665c40](https://github.com/stainless-commons/stripe-python/commit/a665c40437d9b383bd5c015f675153c5b876517e)) +* **internal:** codegen related update ([7d3763e](https://github.com/stainless-commons/stripe-python/commit/7d3763eadb0a7fb5e58371592ebade2472ba8c3a)) +* **internal:** codegen related update ([32491ca](https://github.com/stainless-commons/stripe-python/commit/32491ca9d2543d11b3dc90c0904cab9ab77cc462)) +* **internal:** codegen related update ([65ba06e](https://github.com/stainless-commons/stripe-python/commit/65ba06e655539c6bf8d41449fc8516417848ba97)) +* **internal:** codegen related update ([17b695e](https://github.com/stainless-commons/stripe-python/commit/17b695ecd0532acd0e19af3ee266ce3514a34a82)) +* **internal:** codegen related update ([80e4496](https://github.com/stainless-commons/stripe-python/commit/80e449622d08e15eaba286c60f12955ff49cb051)) +* **internal:** make `test_proxy_environment_variables` more resilient ([09dfc73](https://github.com/stainless-commons/stripe-python/commit/09dfc739821286e53d3faef95946384e7de6ed7a)) +* **internal:** make `test_proxy_environment_variables` more resilient to env ([ee9ae9e](https://github.com/stainless-commons/stripe-python/commit/ee9ae9efd7b7596ed7e9ff7345058fc55df2b9f0)) +* **internal:** refactor authentication internals ([50a4731](https://github.com/stainless-commons/stripe-python/commit/50a4731ff1da1cf30e789e081d3c0d7cafd977a1)) +* **internal:** tweak CI branches ([0aafb30](https://github.com/stainless-commons/stripe-python/commit/0aafb30d64e513a37c14551533fabf353026ed13)) +* **internal:** update gitignore ([468b5ec](https://github.com/stainless-commons/stripe-python/commit/468b5ec187aea033e4b993334e6a58d4004ea2c9)) +* **test:** do not count install time for mock server timeout ([73fc33b](https://github.com/stainless-commons/stripe-python/commit/73fc33bf6ba7759a4bf5b8ce672f4866d744f628)) +* **test:** enable generated tests ([81c8402](https://github.com/stainless-commons/stripe-python/commit/81c84023ed762036e97a88e85684cc5fa25d1adf)) +* **tests:** bump @stdy/cli to 0.16.1 ([1b8ece0](https://github.com/stainless-commons/stripe-python/commit/1b8ece00e53ee181f69119e1925c24afc2319428)) +* **tests:** bump mock server version ([e306ac0](https://github.com/stainless-commons/stripe-python/commit/e306ac08b2eb0d0385aa5d26c6b540a1988382eb)) +* **tests:** bump steady to v0.19.4 ([5411b66](https://github.com/stainless-commons/stripe-python/commit/5411b66e3ecf143da5fd0d2280bb35a07b192585)) +* **tests:** bump steady to v0.19.5 ([f2d5d32](https://github.com/stainless-commons/stripe-python/commit/f2d5d329055049db5a46643a3d531e210b69028a)) +* **tests:** bump steady to v0.19.6 ([fee581f](https://github.com/stainless-commons/stripe-python/commit/fee581fddb74d78b5dc980cd98037291b1a1368b)) +* **tests:** bump steady to v0.19.7 ([24b91ef](https://github.com/stainless-commons/stripe-python/commit/24b91efc0b1d6fc51c673701a09a8e80dfb57590)) +* **tests:** bump steady to v0.20.1 ([2cdebcb](https://github.com/stainless-commons/stripe-python/commit/2cdebcb70d3b9e880766370c8f140bf5b615a4b4)) +* **tests:** bump steady to v0.20.2 ([c62b77b](https://github.com/stainless-commons/stripe-python/commit/c62b77b128486421f209a4d36cd376a363224960)) +* update mock server docs ([bcd2711](https://github.com/stainless-commons/stripe-python/commit/bcd27117fb081aa59df24e034678c8dea078259b)) + + +### Documentation + +* improve examples ([eed185a](https://github.com/stainless-commons/stripe-python/commit/eed185a397e3447a11bdbb420aeacd04f7852b46)) + ## 0.1.0 (2026-02-12) Full Changelog: [v0.0.1...v0.1.0](https://github.com/stainless-commons/stripe-python/compare/v0.0.1...v0.1.0) diff --git a/pyproject.toml b/pyproject.toml index f4b0130..bb1dd6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "stainless_commons_stripe" -version = "0.1.0" +version = "0.2.0" description = "The official Python library for the Stripe API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/stainless_commons_stripe/_version.py b/src/stainless_commons_stripe/_version.py index b79dda0..21acbee 100644 --- a/src/stainless_commons_stripe/_version.py +++ b/src/stainless_commons_stripe/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "stainless_commons_stripe" -__version__ = "0.1.0" # x-release-please-version +__version__ = "0.2.0" # x-release-please-version