Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Pattern for when to use URI string or JSON object #1284
Reviewing the situations when we use URIs as strings rather than as the
If a URI could be treated as a value in an enumerated list, such that the context could assign a short form to it, then the URI MUST be given as a string. Conversely, if this is not the case and the number of resources is either unbounded or impossible to enumerate, it MUST be given in the object form with at least an
There are a countable number of renderingHints, renderingDirections, choiceHints, timeModes, profiles, features, and types, which must thus all be strings. There is an uncountable number of logos, licenses, thumbnails, canvases, images, etc. which thus must be given as objects.
This was referenced
Oct 9, 2017
1 similar comment
To @workergnome 's point, I think that stuffing an extension URI into a field where a string is expected ends up being OK. An unaware client might interpret the URI as a string, but it would be unique and unsupported, and so ignored.
Minor mathy technical comment: the set of all URIs is countable, so the difference is between a small number of
referenced this issue
Mar 8, 2018
Change to consider towards #1479 fix is that we want to allow widely used / well known URIs defined by other specifications to be used directly without defining an alias for them in the context. This results in arrays with both short strings and URIs, but that's okay ... the viewer just needs to process the URI as a string.
Proposed change to the last sentence of the middle paragraph (the actual text):