Skip to content

Conversation

@hounddog22030
Copy link
Contributor

Description of changes:

If the LambdaSerializerAttribute is missing, during invocation of function, the error message of "Could not find the LambdaSerializerAttribute on the assembly 'XXX' or method 'XXX' while attempting to deserialize input data of type 'XXX'. To use types other than System.IO.Stream as input/output parameters, the assembly or Lambda function should be annotated with Amazon.Lambda.LambdaSerializerAttribute." incorrectly names "Amazon.Lambda.LambdaSerializerAttribute". Should be "Amazon.Lambda..Core.LambdaSerializerAttribute"

Fixed by using typeof(LambdaSerializerAttribute).FullName.

I see below that my fork master also has the other PR (#1202) in it, so maybe review it first. I guess I need to not merge my changes into my fork/master anymore. Sorry.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@normj normj changed the base branch from master to dev July 26, 2022 23:38
if (customerSerializerInstance == null)
{
throw LambdaExceptions.ValidationException(Errors.UserCodeLoader.SerializeMissingAttribute,
_handler.AssemblyName, _handler.MethodName, dataType.FullName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slight perf, we should cache the typeof(LambdaSerializerAttribute) in a member to avoid performing same operation. Not ship blocking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to cache it? If it runs that code and throws that Exception, it's lights out, fatal error, isn't it?

@normj normj merged commit 2971244 into aws:dev Aug 26, 2022
@normj
Copy link
Member

normj commented Aug 26, 2022

Thanks for the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants