Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: make duplicate JSON keys an error

by McA (Curate)
on Oct 24, 2013 at 12:16 UTC ( #1059444=note: print w/ replies, xml ) Need Help??


in reply to Re: make duplicate JSON keys an error
in thread make duplicate JSON keys an error

This must have been a very short idle moment... ;-)

The above json snippet gets parsed without errors. The problem is, that the resulting hash does only have one key 'op' and the value seems to be the last parsed value. So the resulting hash does have only three distinct keys. You can't see at the parsing result whether the delivered json snippet was not valid according to the mentioned RFC.

UPDATE: Looking at the documentation of the JSON module showed that the behaviour can be influenced by several variables. But non of them is targeting your problem. The possibility of incremental parsing seems also not solve your problem. So, my conclusion: Make a feature request to add a behaviour config variable disallowing multiple equal keys. Knowing that won't help you at the moment.

Best regards
McA


Comment on Re^2: make duplicate JSON keys an error

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1059444]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2014-08-28 10:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (259 votes), past polls