Loading ...
Sorry, an error occurred while loading the content.

1916Re: Non-unique keys in JSON objects

Expand Messages
  • douglascrockford
    Sep 5, 2012
    • 0 Attachment
      --- In json@yahoogroups.com, Jonathan Wallace <ninja9578@...> wrote:

      > Libjson will parse them all, if you attempt to get the object by its key and said key is not unique, it will give you the first one. The only way to get the second would be to use an integrator and check the keys one by one. I've had a few requests to throw exceptions in the case of multiple objects with the same key, but it would break the standard.

      You can do as you like, but I think it would be better if you throw the exception.
    • Show all 6 messages in this topic