Commit a85c7a7
authored
Fixes and tests for decoding binary items and empty lists in DynamoDBEvent.Decoder (#103)
Cleaned up version of
[#61](#61) that
also has tests.
This PR makes it so that in lists, the decoder will not try to access
the 0th index of an empty array.
This PR will also make it so that `AttributeValue`s of type `.binary`
will properly decode to base64 Strings when String is put as the type in
the the `Decodable`. To avoid including `Data` in the code, I included
code from the original source of the base 64 decoding methods
(https://github.com/fabianfett/swift-base64-kit) to add in the
corresponding encoding methods. However, I saw lots of Foundation is
imported throughout so I reverted it. What are your thoughts on this
matter?
I also added tests that aim to make these failure points more resilient
in the future.1 parent f6fc221 commit a85c7a7
File tree
2 files changed
+70
-6
lines changed- Sources/AWSLambdaEvents
- Tests/AWSLambdaEventsTests
2 files changed
+70
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
465 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
466 | 471 | | |
467 | 472 | | |
468 | | - | |
469 | | - | |
470 | 473 | | |
471 | 474 | | |
472 | 475 | | |
| |||
651 | 654 | | |
652 | 655 | | |
653 | 656 | | |
654 | | - | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
655 | 663 | | |
656 | 664 | | |
657 | | - | |
658 | | - | |
659 | 665 | | |
660 | 666 | | |
661 | 667 | | |
| |||
769 | 775 | | |
770 | 776 | | |
771 | 777 | | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
772 | 781 | | |
773 | 782 | | |
774 | 783 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
254 | 309 | | |
0 commit comments