Repository navigation
Conversation
This branch has not been deployed
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.
Issue #, if available: #1686
Description of changes:
[FromHeader]parameters are bound withConvert.ChangeType, so a type likeGuidor a user-defined type compiles fine and then throwsInvalidCastExceptionat runtime.[FromQuery]already rejects these at build time (AWSLambda0109). As discussed on the issue, this adds the same check for headers as an interim step; supporting custom types (e.g.IParsable<T>) is left for a separate feature.AWSLambda0146("Unsupported Header Parameter Type"), reported when a[FromHeader]parameter is not a primitive .NET type or an enumerable of one.ALB.FromHeaderAttribute).AnalyzerReleases.Unshipped.md..autover/changes/.ComplexHeaderParameters_AreNotSupported(mirrors the existingComplexQueryParameters_AreNotSupported) using aGuidheader parameter.Testing: ran
Amazon.Lambda.Annotations.SourceGenerators.Tests(SourceGeneratorTests, ALB and authorizer binding tests) on GitHub Actions in my fork for net8.0 and net10.0: 149 passed, 0 failed per target. The repo's own AWS CI needs credentials, so it was not run. The repo's existing test apps only use primitive header types, so nothing existing should be affected.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.