Skip to content
This repository was archived by the owner on Jun 18, 2024. It is now read-only.
This repository was archived by the owner on Jun 18, 2024. It is now read-only.

Need consistent JSON serialization for properties with (0,n) + (1,n) cardinality #39

Closed

Description

@willpugh

There are a number of fields (and I've noticed a few other more specific issues in this genre) around what to do in the case of fields that can have multiple values.

Examples are:
accessURL,
format,
keyword,
category,
references,
distribution,
feed

Some of these give guidance. "keyword" and "references" both give guidance to use commas to separate values, but many of the other ones don't.

I would propose that for the serialization, all fields that can have an arbitrary number of values should use arrays. Not commas.

That way we can be consistent, and callers don't need to parse strings to get multiple values. They can use the build in JSON constructs.

In addition, the "references" property suggests that URLs should be separated by commas. However, commas are valid characters in URLs. This means that in order to make the mechanism reliable, you need to add another layer of encoding on it, which is an unnecessary burden on developers.

Activity

  1. jpmckinney commented on May 16, 2013

    @jpmckinney
    Contributor

    +1 It's JSON - use arrays! Arrays are much less error-prone than commas.

  2. mhogeweg commented on May 16, 2013

    @mhogeweg
    Contributor

    +1 see also issue #33.

  3. MarinaNitze commented on Aug 25, 2013

    @MarinaNitze
    Contributor

    I believe all of the incorrect serializations are now fixed in #44. Also fixed references and keywords by making them into arrays. Closing, but let me know if there are still issues. Appreciate your eagle eyes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions