smuellener
-
Posts
4 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Gallery
Posts posted by smuellener
-
-
Hi
When we try to deserialize a Json Array but (wrongly) provide an empty string as an argument, the VI JSON Value.lvclass:Read Array.vi crashes yielding the error: "<ERR> Not a JSON Array". I suggest returning an empty/default element of the type to deserialize in instead. This would be the same behaviour for arrays as for single objects.
Thank you
Steven
-
I agree with you that framework specific functionality should definitely not be included in the library itself. In this case though we are not talking about asp.net or any framework what so ever.
If anyone is using microseconds resolution (which is totally possible for many labview specific applications), he can not directly use this very useful library to work with the timestamps from json (it will not be recognised at all and the decimal part cut entirely to 0). A solution to this is also not easily added as a warapper or extension.
ISO 8601 states that there is "no limit on the number of decimal places for the decimal fraction". I would therefore suggest to support 6 and 7 decimal places as well or even go up to nanoseconds resolution (although I personally do not use it but someone else might use timestamps down to nanoseconds in the future):
%^<%Y-%m-%dT%H:%M:%S%9u>T
%^<%Y-%m-%dT%H:%M:%S%8u>T
%^<%Y-%m-%dT%H:%M:%S%7u>T
%^<%Y-%m-%dT%H:%M:%S%6u>T
-
Hello
We connect from LabView to an ASP.NET API and deserialize the data using this toolkit. For the received DateTime strings of the form 2016-02-04T16:02:36.4537156+01:00, the VI "Scan Timestamp.vi" does not recognize the server's timestamps (using the template %^<%Y-%m-%dT%H:%M:%S%u>T)
we had to explicitly add the following to the top of the string templates:
%^<%Y-%m-%dT%H:%M:%S%7u>T
%^<%Y-%m-%dT%H:%M:%S%6u>T
in order for the fractional seconds part to be recognized. As our string is a standard and used in all ASP.NET we would be greatful if you could include it in the next release. Should we update the vi and upload it here?
Thank you
Steven
[CR] JSON LabVIEW
in Code Repository (Certified)
Posted
When receiving a http response from a http api (fi to a POST request), the response should be 200 (ok) and may contain a body (to deserialize). When something goes wrong, that body may not contain any elements (empty string). We have two options:
1. Add validy check every time before calling deserialization VIs for them not to crash (and possibly catching errors if it does crash)
2. The deserialization VIs could simply not crash in the first place returning an empty array
Which way do you prefer?