Skip to content
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
willpugh opened this issue May 16, 2013 · 3 comments

Comments

@willpugh
Copy link
Contributor

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.

@jpmckinney
Copy link
Contributor

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

@mhogeweg
Copy link
Contributor

+1 see also issue #33.

@MarinaNitze
Copy link
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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants