# New Ticket Created by  Zoffix Znet 
# Please include the string:  [perl #127252]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=127252 >


The newest JSON spec—contrary to previous versions—does allow non-object/array 
things at the top level. Reference: http://rfc7159.net/rfc7159#rfc.section.2 
(second paragraph, especially).

Rakudo's from-json built-in, however, displays an error when attempting to 
decode JSON conforming to this newest spec:

<Zoffix> m: say from-json "42"
<camelia> rakudo-moar 5ed58f: OUTPUT«Invalid JSON: 42␤  in block <unit> at 
/tmp/r522Mw8UZf line 1␤␤»
<Zoffix> m: say from-json "false"
<camelia> rakudo-moar 5ed58f: OUTPUT«Invalid JSON: false␤  in block <unit> at 
/tmp/eCGN9CXVDB line 1␤␤»
<Zoffix> m: say from-json '"42"'
<camelia> rakudo-moar 5ed58f: OUTPUT«Invalid JSON: "42"␤  in block <unit> at 
/tmp/kfesR2DMMW line 1␤␤»

Reply via email to