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

parse input containing NaN and Infinity values #434

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

trinitum
Copy link

JSON standard does not allow NaN or Infinity, but some applications
produce output that contains such values. One example of such
application would be TensorFlow Serving[1]. An example of JSON parser
that accepts NaN and Infinity is the one that comes with Python[2]. This
commit introduces a new configuration parameter AllowNaN, that enables
jsoniter to unmarshal input containing NaN and Infinity.

  1. https://www.tensorflow.org/tfx/serving/api_rest#json_conformance
  2. https://docs.python.org/3/library/json.html#infinite-and-nan-number-values

@codecov
Copy link

codecov bot commented Jan 15, 2020

Codecov Report

Merging #434 into master will increase coverage by 0.16%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #434      +/-   ##
==========================================
+ Coverage   86.46%   86.63%   +0.16%     
==========================================
  Files          41       41              
  Lines        5106     5139      +33     
==========================================
+ Hits         4415     4452      +37     
+ Misses        555      552       -3     
+ Partials      136      135       -1
Impacted Files Coverage Δ
config.go 89.36% <ø> (ø) ⬆️
iter.go 90.18% <100%> (+0.09%) ⬆️
iter_float.go 90.53% <100%> (+2.11%) ⬆️
reflect_struct_decoder.go 81.62% <0%> (+0.26%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 49c900e...30c89f8. Read the comment docs.

JSON standard does not allow NaN or Infinity, but some applications
produce output that contains such values. One example of such
application would be TensorFlow Serving[1]. An example of JSON parser
that accepts NaN and Infinity is the one that comes with Python[2]. This
commit introduces a new configuration parameter AllowNaN, that enables
jsoniter to unmarshal input containing NaN and Infinity.

1. https://www.tensorflow.org/tfx/serving/api_rest#json_conformance
2. https://docs.python.org/3/library/json.html#infinite-and-nan-number-values
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

Successfully merging this pull request may close these issues.

1 participant