You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to unmarshall the output of show interfaces transceiver dom thresholds, you sometimes can come across a channel value with -Infinity. This causes the JSON decoder to fail with an error like this:
interface-diagnostics: invalid character 'I' in numeric literal"
It seems that -Infinity isn't valid JSON, so it isn't supported by the JSON parser. So what is the way to handle this so you can at least skip over this value and still get the rest of the valid data back?
The text was updated successfully, but these errors were encountered:
@mngan Interesting. What version of EOS are you running against?
I would expect EOS to return valid JSON...so I'm inclined to say an issue should be filed against EOS. However, I do agree we should have at least some method to workaround issues like this. Unfortunately, we do not at the moment. Let me look into this more.
I am seeing this on 4.24.2.2F through 4.25.4M. I'll log a case with Arista on this. JSON not defining NaN and Infinity as literals is a little unexpected though.
Yeah. It's specifically stated in rfc4627 (https://datatracker.ietf.org/doc/html/rfc4627#section-2.4).
There's been debate on this in the past. Even with respect to how python/ruby/etc handle vs Golang. Seems Go is a tad more strict.
When trying to unmarshall the output of
show interfaces transceiver dom thresholds
, you sometimes can come across a channel value with -Infinity. This causes the JSON decoder to fail with an error like this:interface-diagnostics: invalid character 'I' in numeric literal"
The JSON object in question looks like this:
It seems that -Infinity isn't valid JSON, so it isn't supported by the JSON parser. So what is the way to handle this so you can at least skip over this value and still get the rest of the valid data back?
The text was updated successfully, but these errors were encountered: