Skip to content

statusCode must be a positive int #7

Description

@antoniuslin

When used with AWS SAM $> sam local start-api command to run as a local lambda, fronted by its mock AWS API Gateway; and upon a curl call $> curl -X POST http://localhost:port/theapi ... I received an {"message":"Internal server error"} response as the curl response. Server-side, it logged the following:

2018-08-10 16:48:18 statusCode must be a positive int
2018-08-10 16:48:18 Function returned an invalid response (must include one of: body, headers or statusCode in the response object). Response received: {"statusCode":"200","body":"{\"Errors\":[{\"Expectation\":\"Required\", ...redacted}]}","headers":{"server":"","content-type":"application/json","date":"Fri, 10 Aug 2018 16:48:17 GMT","content-length":152}}
2018-08-10 16:48:18 127.0.0.1 - - [10/Aug/2018 16:48:18] "POST /theapi HTTP/1.1" 502 -

How could I change or override the response before its sent out so from {"statusCode":"200"...} to {"statusCode": 200...}?
Not sure if this is a real bug or a user-error (me).

Thanks.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions