Commit f7cc76c
Fix JSON conversion bug in template PUT endpoint
Fixed a bug where empty dictionaries for configurations, secrets, and schemas
were incorrectly converted to NULL in the database instead of empty JSON objects.
Changed the condition from 'if value' to 'if value is not None' for:
- configurations_json
- secrets_json
- expected_payload_schema_json
- expected_callback_response_schema_json
This ensures that:
- None → NULL in database (intended behavior)
- {} → "{}" (empty JSON object, now works correctly)
- {"key": "value"} → JSON string (continues to work)
The bug was causing configuration updates to fail silently when the resulting
dict was empty or falsy, as Python treats empty dicts as falsy.
https://claude.ai/code/session_01N3rCYzU3puAwWKG1mszpHh1 parent f03faca commit f7cc76c
1 file changed
Lines changed: 16 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
112 | | - | |
| 114 | + | |
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
117 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | | - | |
| 124 | + | |
121 | 125 | | |
122 | 126 | | |
123 | 127 | | |
| |||
332 | 336 | | |
333 | 337 | | |
334 | 338 | | |
335 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
336 | 342 | | |
337 | 343 | | |
338 | 344 | | |
339 | | - | |
| 345 | + | |
340 | 346 | | |
341 | 347 | | |
342 | 348 | | |
343 | 349 | | |
344 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
345 | 353 | | |
346 | 354 | | |
347 | | - | |
| 355 | + | |
348 | 356 | | |
349 | 357 | | |
350 | 358 | | |
| |||
0 commit comments