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

NaN in JSON is not parsed correctly #640

Closed
pavel-kirienko opened this issue May 7, 2022 · 4 comments
Closed

NaN in JSON is not parsed correctly #640

pavel-kirienko opened this issue May 7, 2022 · 4 comments
Assignees
Labels

Comments

@pavel-kirienko
Copy link

Per the JSON specification, NaN floats cannot be represented natively, so many encoders substitute NaN with null. One would expect PJ to handle null values in JSON input as NaN for compatibility with this common case. Instead, we get this:

image

The JSON doc I used is:

{
  "1252": {
    "timestamp": {
      "microsecond": 0
    },
    "value": {
      "current": {
        "ampere": null
      },
      "voltage": {
        "volt": 24.852617263793945
      }
    }
  }
}
@facontidavide
Copy link
Owner

I updated the JSOn parse and I think this fixed the issue

@pavel-kirienko
Copy link
Author

@facontidavide Thanks! But the issue is still there though :D

@facontidavide
Copy link
Owner

sorry to hear that. I will try to address it in the next release

@facontidavide facontidavide reopened this Aug 5, 2022
@facontidavide facontidavide self-assigned this Aug 5, 2022
@facontidavide
Copy link
Owner

I have just tried and it works just fine
image

Closing not being reproducible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants