Skip to content

feat(client): accept dictionary request bodies - #326

Draft
babbarutkarsh wants to merge 1 commit into
openfga:mainfrom
babbarutkarsh:feat/dictionary-request-bodies
Draft

babbarutkarsh wants to merge 1 commit into
openfga:mainfrom
babbarutkarsh:feat/dictionary-request-bodies

Conversation

@babbarutkarsh

Copy link
Copy Markdown

High-level client methods currently access request attributes directly, so passing a dictionary to methods such as check or write raises before sending a request. Accept dictionaries using the corresponding Python request constructor arguments in both sync and async clients, including nested client tuples and batch items and list-based helpers.

Use shared normalization without mutating dictionary-only inputs. Preserve existing model instances and their behavior, and document that nested generated-model dictionaries retain direct serialization/server validation. Generated files are unchanged.

Closes #15

Validation:

  • 577 unit tests passed, including 51 new cases across sync and async clients; 12 server integration tests excluded.
  • Overall coverage: 70.50%, above the repository's 60% threshold.
  • Ruff lint and formatting checks passed; the new normalization helper passes a focused mypy check.
  • Tests cover HTTP payloads, nested conditions/context, streaming, writes without transactions, batch chunking, invalid constructor arguments, and preservation of caller dictionaries.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

CLA Not Signed

@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@babbarutkarsh
babbarutkarsh force-pushed the feat/dictionary-request-bodies branch from 53f333c to 0f7fdea Compare November 1, 2026 04:16
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.

Allow passing in request as a dictionary that the SDK can attempt to parse into the required classes

1 participant