Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion: should namespaces be applied to normal properties too? #4

Open
JornWildt opened this issue Jan 29, 2014 · 1 comment
Open
Labels

Comments

@JornWildt
Copy link
Owner

Namespaces are originally designed for link-relations and action names since these have a history of using URIs for identifiers.

The same idea could as well be applied to API data such that it becomes possible to mix data from different sources without name collisions (much like XML namespaces). That might though be too complicated to be worth it.

Example:

{
  "@namespaces":
  {
    "n1": { name: "acme.inc" },
    "n2": { name: "sultan.inc" }
  },

  "n1:Title": "Title for Acme data",
  "n2:Title": "Title for Sultan data",
  ...
}

One could also simply use sub-properties:

{
  "acme.inc":
  {
    "title: "Title for Acme data"
  },
  "sultan.inc":
  {
    "title: "Title for Sultan data"
  },
  ...
}
@dillonredding
Copy link

One thing I noticed with Mason is a lack of specifying the link relation type for embedded resources. That's where something like this would come in handy. However, when it comes to using IANA-registered link relations, the problem still remains since there's no need for a URI.

This is likely all moot given issue #19 though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants