Repository navigation
fix(parser): accept multi-value headers in VPC Lattice v2 events - #5773
Merged
dreamorosi merged 1 commit intoOct 3, 2026
Merged
dreamorosi merged 1 commit into
dreamorosi merged 1 commit into
Conversation
VPC Lattice sends every header and query string value in a V2 event as an array of strings, even a single value, but VpcLatticeV2Schema typed both as records of strings, so every real event failed to parse and VpcLatticeV2Envelope could not parse any event. Type both as records of string arrays and declare the top-level requestId, which was stripped. Replace the hand-written fixture with an event captured from a live V2 target group, so the existing round-trip test covers the real shape, and update the envelope tests to its body. Closes aws-powertools#5764
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VPC Lattice sends every header and query string value in a V2 event as an array of strings, even when there is a single value, but
VpcLatticeV2Schematyped both as records of strings. Every real V2 event failed to parse, soVpcLatticeV2Envelopecould not parse any event. This types both fields as arrays and keeps the top-levelrequestId.Changes
headersandqueryStringParametersinpackages/parser/src/schemas/vpc-latticev2.tstoz.record(z.string(), z.array(z.string())).requestIdas an optional string, so it is no longer stripped.packages/parser/tests/events/vpc-lattice-v2/base.jsonwith the event captured from a live V2 target group in the issue. The existing round-trip test in the schema tests now covers single and repeated values andrequestId, and fails against the schema onmain.content-typeheader as an array.principalOrgID,x509SubjectCnand similar) unchanged, since it needs a live event with IAM auth or Roles Anywhere to confirm.This changes the inferred
VpcLatticeEventV2type forheadersandqueryStringParameters. Since no real event could pass the previous schema, no working code can depend on the old shape.Issue number: closes #5764
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.