Description
aws_lambda_events
is almost entirely composed of structs and enums with public inner fields. This creates a constant semver hazards as we can't add new fields without breaking semver. Meanwhile, we are mapping external schemas that do frequently add fields.
For now, we just bump semver whenever we add events, but that is pretty painful for consumers to always bump, and otherwise they might be silently ignoring payload fields that serde_json
doesn't recognize. It would be nicer for them to be able to eg dump the full event input via their debug logs and always see the latest fields, even without handling them explicitly in their application code.
For enums, this seems like a no-brainer. For structs, it's a bit awkward since we'll probably want to implement Default
for everything so that unit testing isn't a pain. But, most structs are comprised of Option<T>
, Vec<T>
, and HashMap<T, T>
fields anyway, which makes #[derive(Default)]
pretty easy. String fields probably are fine to just default to ""
.
Anyway, it's a lot of gruntwork, but probably a good idea to do as part of an eventual 1.0
release at least? Might be good LLM fodder ^^
It is also pretty unpleasant for our consumers if they have struct initialization in their tests (or maybe as part of their handler responses). Hence it might be better as part of a larger 1.0
migration.