Skip to content

Amazon.Lambda.Annotations code generation explicit dependent on Amazon.Lambda.APIGatewayEvents #1204

Description

@Simonl9l

Describe the bug

When experimenting with Amazon.Lambda.Annotations it seem that one also has to have Amazon.Lambda.APIGatewayEvents as a package reference in the project or the generated code can not compile.

This is neither noted in the Amazon.Lambda.Annotations README.md nor logically required if on just wants to deploy an HTTP Triggered Lambda without any API Gateway integration.

Expected Behavior

The generated code to compile without the need to add an explicit dependency, if this is required, that it should be a dependency of Amazon.Lambda.Annotations

Current Behavior

 "/Users/<user>/Projects/<path>/src/TestCGLambda/TestCGLambda.csproj" (default target) (1:7) ->
       (CoreCompile target) -> 
         /Users/<user>/Projects/<path>/TestCGLambda/Function.cs(11,5): error AWSLambda0104: Your project has a missing required package dependency. Please add a reference to the following package: Amazon.Lambda.APIGatewayEvents [/Users/l<user>/Projects/<path>/src/TestCGLambda/TestCGLambda.csproj]
         CSC : error AWSLambda0001: This is a bug. Please run the build with detailed verbosity (dotnet build --verbosity detailed) and file a bug at https://github.com/aws/aws-lambda-dotnet with the build output and stack trace Object reference not set to an instance of an object.   at Amazon.Lambda.Annotations.SourceGenerator.Models.TypeModelBuilder.Build(ITypeSymbol symbol, GeneratorExecutionContext context) [/Users/l<user>/Projects/<path>/src/TestCGLambda/TestCGLambda.csproj]

Reproduction Steps

build sample per README.md omitting Amazon.Lambda.APIGatewayEvents from referenced packages.

Possible Solution

No response

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

Targeted .NET Platform

.NET 6

Operating System and version

OSX Monterey

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions