Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApiGatewayProxyRequest.Resource not properly set using SAM Local #287

Closed
tfnaylor opened this issue Feb 1, 2018 · 2 comments
Closed

ApiGatewayProxyRequest.Resource not properly set using SAM Local #287

tfnaylor opened this issue Feb 1, 2018 · 2 comments

Comments

@tfnaylor
Copy link

tfnaylor commented Feb 1, 2018

Given a SAM template with the following configuration (partial):

Resources:
  Create-Condition:
    Type: AWS::Serverless::Function
    Properties:
      Runtime: go1.x
      Handler: main
      CodeUri: .
      Events:
        Get-Condition:
          Type: Api
          Properties:
            Path: /api/conditions/{id}
            Method: GET

When invoking the endpoint locally using SAM Local and Postman as follows:

localhost:3000/api/conditions/12345

The value of the ApiGatewayProxyRequest.Resource property ends up as "/api/conditions/12345". When invoking the same operation against the template deployed to AWS, you get what seems like the correct value of "/api/conditions/{id}".

This seems like a bug to me and an important one if you are routing to handlers based on the resource path.

@tfnaylor tfnaylor changed the title ApiGatewayProxyRequest.ResourcePath not properly set using SAM Local ApiGatewayProxyRequest.Resource not properly set using SAM Local Feb 1, 2018
@kind3r
Copy link

kind3r commented Feb 2, 2018

Duplicate of #244

@jfuss
Copy link
Contributor

jfuss commented May 10, 2018

This was corrected in the 0.3.0 release. Closing since this has been addressed.

@jfuss jfuss closed this as completed May 10, 2018
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

No branches or pull requests

3 participants