When testing my CustomAuthorizer I got the missing 'cookies' field parsing error. It seems to be a required attribute without default setting, however it is not (always) provided by API Gateway.
Changes
Added the serde default annotation to let Serde assume an empty cookie Vec in case the cookie attribute is not part of the request
Added an example json without the cookie attribute
Added a test for an example request json without the cookie attribute
Fixed the test above that implied (the test function name) to be testing the same struct, but was actually using a different struct within the test
I hope this PR adds value, let me know if it raises any questions!
Context
When testing my CustomAuthorizer I got the
missing 'cookies' field
parsing error. It seems to be a required attribute without default setting, however it is not (always) provided by API Gateway.Changes
default
annotation to let Serde assume an empty cookie Vec in case the cookie attribute is not part of the requestI hope this PR adds value, let me know if it raises any questions!