Skip to content

feat(sdk)!: flatten request body arguments#279

Merged
matoous merged 2 commits intomainfrom
md/body-arguments
Apr 23, 2026
Merged

feat(sdk)!: flatten request body arguments#279
matoous merged 2 commits intomainfrom
md/body-arguments

Conversation

@matoous
Copy link
Copy Markdown
Contributor

@matoous matoous commented Apr 22, 2026

Update the Python SDK generator to expose declared top-level JSON request body fields as keyword-only
method arguments instead of requiring explicit body= model construction, and regenerate the SDK with the
new signatures. Refresh the README and examples to use the flattened call style so the public usage
matches the generated API.

Migration Guide

Request body objects are now flattened into method keyword arguments. You no longer need to construct/
pass the generated request body type explicitly.

Before:

sdk.subaccounts.update_sub_account(
  1,
  body=UpdateSubAccountBodyInput(
      nickname="New name",
  ),
)

After:

sdk.subaccounts.update_sub_account(
  1,
  nickname="New name",
)

Required body fields are now required keyword arguments:

sdk.subaccounts.create_sub_account(
  username="operator@example.com",
  password="correct horse battery staple",
)

Optional flattened request-body parameters now distinguish omitted fields from explicit JSON null.

If you omit an optional body argument, the SDK omits it from the JSON payload:

sdk.subaccounts.update_sub_account(1)
# Sends: {}

If you pass None, the SDK sends an explicit JSON null:

sdk.subaccounts.update_sub_account(1, nickname=None)
# Sends: {"nickname": null}

For query parameters, omitted parameters and None are both omitted from the query string:

sdk.transactions.list("merchant-123")
# No optional query params sent

sdk.transactions.list("merchant-123", limit=None)
# "limit" is omitted

@matoous matoous self-assigned this Apr 22, 2026
@matoous matoous force-pushed the md/body-arguments branch 3 times, most recently from 96c9c16 to 2bfa547 Compare April 22, 2026 23:19
Update the Python SDK generator to expose declared top-level JSON request body fields as keyword-only
method arguments instead of requiring explicit body= model construction, and regenerate the SDK with the
new signatures. Refresh the README and examples to use the flattened call style so the public usage
matches the generated API.
@matoous matoous force-pushed the md/body-arguments branch 5 times, most recently from 8f80e6f to 5d03a11 Compare April 23, 2026 10:05
@matoous matoous force-pushed the md/body-arguments branch from 5d03a11 to b573d2b Compare April 23, 2026 10:14
@matoous matoous changed the title feat(sdk): flatten request body arguments in generated Python methods feat!(sdk): flatten request body arguments Apr 23, 2026
@matoous matoous changed the title feat!(sdk): flatten request body arguments feat(sdk)!: flatten request body arguments Apr 23, 2026
@matoous matoous merged commit ee84b04 into main Apr 23, 2026
11 of 14 checks passed
@matoous matoous deleted the md/body-arguments branch April 23, 2026 10:19
This was referenced Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant