添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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

That's a "feature" of the standard library json.dumps 😞

If allow_nan is true (the default), then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders.

Chalice json.dumps Response bodies (unless it's a string) here .

And FWIW, in json.dumps there's an allow_nan instead of the ignore_nan from simplejson. However the allow_nan will raise an exception instead of ignoring the NaN.

To workaround the issue, you can simplejson.dumps the values yourself and return a chalice.Response object instead.

I think we should allow for some sort of custom hook that allows you to transform data before we serialize the data, similar to what's proposed in #719 .