Wrong type in json
See original GitHub issueHere https://github.com/ebroecker/canmatrix/issues/102 not only the internal representation but also the json export itself were changing. That lead to
"factor": str(signal.factor),
"offset": str(signal.offset),
"min": str(signal.min),
"max": str(signal.max),
In my opinion it is okay to handle it internally as a different type but json allows floating point numbers, so why not use it? The change basically requires everyone using such an exported json to convert the string back to float.
May I ask why this was changed? Any chance to revert the export back to using float instead of string?
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Json Exception wrong type - java - Stack Overflow
Problem is at line "info": {} in your json string. Your class have private String info; String type and in your JSON string...
Read more >SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
JSON.parse() parses a string as JSON. This string has to be valid JSON and will throw this error if incorrect syntax was encountered....
Read more >JSON error handling
In cases where a JavaScript Object Notation (JSON) transaction fails, the API Gateway can use a JSON error to convey error information to...
Read more >Unmarshaling json in Go (error checking missing)
Hi, as I understand Go presumes strict error handling. So why there is no way to way to check if json was unmarshaled...
Read more >How to allow some kinds of invalid JSON with System.Text.Json
In this article, you will learn how to allow comments, trailing commas, and quoted numbers in JSON, and how to write numbers as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, I understand now. How about adding a --useNativeTypes argument that basically does what the name suggests: use native data types of the output format?
By default it is all strings (which we should mention in the docs) and if that arg is given you use whatever the output format allows.
OK, I’ll implement it as soon as I have time. (likely in the next few days). I will only add that option to work with json though, we can expand it as needed.