Re:Parsing JSON is a Minefield
by grondo4 on Wednesday October 26, 2016 @04:33PM
(#12800203)
Doesn't Java lack a JSON parser in the standard library?
[ Parent
| on HN ]
As of Java 8, the Nashorn JavaScript engine is included by default, and it does support JSON parsing.
[1] http://winterbe.com/posts/2014/04/05/java8-nashorn-tutorial/
Re:Parsing JSON is a Minefield
by prodigal_erik on Wednesday October 26, 2016 @05:23PM
(#12800723)
The standard Java library includes a JavaScript interpreter, so there has to be a parser for object literals in there somewhere.
Re:Parsing JSON is a Minefield
by tree_of_item on Wednesday October 26, 2016 @06:37PM
(#12801351)
Object literals aren't JSON, though.
JS has stringify and parse, so there ought to be a JSON parser somewhere.
One thing that the article mentions is that there are in fact strings that are valid JSON but not valid JS object literals.
https://developer.mozilla.org/en/docs/Web/JavaScript/Referen...
A modern JS implementation should also have a JSON parser