Commit bab4474
committed
feat: ensure annotation keys always present in serialized output
Modify AnnotationsMixin.serialize_annotations() to always include
'text-annotations' and 'range-annotations' keys in the returned dict,
even when the lists are empty. Previously, these keys were only added
when annotations existed.
This change ensures consistent API response structure and prevents
potential KeyError issues when consumers expect these keys to always
be present.1 parent d5a0701 commit bab4474
1 file changed
Lines changed: 13 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
303 | | - | |
| 302 | + | |
| 303 | + | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
311 | 313 | | |
312 | | - | |
313 | | - | |
| 314 | + | |
| 315 | + | |
314 | 316 | | |
315 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
316 | 321 | | |
317 | 322 | | |
318 | 323 | | |
| |||
0 commit comments