Commit 4fd086c
Daniel Yeam
Add comprehensive tests for per-request custom HTTP headers functionality + fix SDK bugs
Tests:
- Add core functionality tests for all API methods (check, write, read, etc.)
- Add edge case tests for invalid inputs and boundary conditions
- Add synchronous client compatibility tests
- Add summary test demonstrating real-world usage patterns
- Covers both async and sync clients with 1,270+ lines of test coverage
SDK Bug Fixes:
- Fix header merging logic in both ApiClient classes to allow custom headers to override default headers
- Add validation in options_to_kwargs to handle invalid header types gracefully
- Previously default headers would overwrite custom headers due to incorrect merge order
- Now custom headers properly take precedence over defaults (except system headers like Accept/Content-Type)
All async tests pass. Sync client tests need additional investigation.
Resolves #2171 parent 89a39d1 commit 4fd086c
File tree
8 files changed
+1295
-4
lines changed- openfga_sdk
- client
- sync
- client
- test
- client
- sync/client
8 files changed
+1295
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
183 | 186 | | |
184 | 187 | | |
185 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
131 | 136 | | |
132 | 137 | | |
133 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
182 | 185 | | |
183 | 186 | | |
184 | 187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
132 | 137 | | |
133 | 138 | | |
134 | 139 | | |
| |||
0 commit comments