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

non-string response body breaks SAM CLI #38

Closed
sanathkr opened this issue Aug 14, 2017 · 0 comments
Closed

non-string response body breaks SAM CLI #38

sanathkr opened this issue Aug 14, 2017 · 0 comments

Comments

@sanathkr
Copy link
Contributor

https://github.com/teknogeek0/aws-serverless-samfarm-api/blob/master/index.js#L25 returns a integer in body property of Proxy response. SAM CLI expects body to be a string when JSON unmarshalling - start.go#L187.

These are valid JSON types: http://json-schema.org/latest/json-schema-core.html#rfc.section.4.2

sanathkr pushed a commit that referenced this issue Aug 14, 2017
…#39)

This uses the json encoding package's json.Number type to transparently
work with both a number and/or a string. If it's a number, the json
encoding will convert it to a string.

See:
http://igorsobreira.com/2015/04/11/decoding-json-numbers-into-strings-in-go.html

Fixes #38.
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

1 participant