awslabs / aws-lambda-rust-runtime

A Rust runtime for AWS Lambda
Apache License 2.0
3.3k stars 335 forks source link

fix: support string or [string] when deserializing `IamPolicyStatement` #854

Closed aesterline closed 5 months ago

aesterline commented 5 months ago

Action and Resource allow both string and [string] as values. Support deserializing IamPolicyStatement with either of these values.

Issue #, if available: fixes: https://github.com/awslabs/aws-lambda-rust-runtime/issues/853

Description of changes: I thought about changing the type of the action and resource fields to be another type that was an enumeration, but it felt like a backward breaking change and I wasn't sure that was acceptable. It seems like there are other cases of deserialize_with, so I thought I would give that approach a shot.

I'm happy to try a different way (enum or other) if that is preferable.

By submitting this pull request

calavera commented 5 months ago

The examples failure is unrelated to these changes. I'm fixing it in https://github.com/awslabs/aws-lambda-rust-runtime/pull/855