Subject: [apps-discuss] Duplicate rels in json-home docs

From: Jan Algermissen <[email-masked]>
Date: Sat, 21 Jul 2012 14:30:34 +0200

Hi Mark,

you clarified for me in our last exchange that your understanding is that relations in json-home documents are unique. That there cannot be more than one resource defined per relation value. (Assuming I replay that correctly here).

I see it the same way.

However, I am now running in a situation, where there are several resources that allow lookup of basically the she kind of information but based on very different lookup vars.

E.g. looking up customers by their customer ID, by ID of any of their accounts or by some other ID, lets say social security number.[1]

Each of these lookup resources return the same <customer> .. <customer> representation and basically have the same semantic (being resources where you can lookup customers).

As a result, I end up with a bunch of different 'forms' for different lookup-parameter combinations.

Now, the uniqueness of the rels in json-home docs prevents me from expressing these 'forms' unless I mint a new relation for each form - which feels like link relation bloat and is also semantically not really correct.

What would be correct is to have the json-home consumer iterate over all forms for a given rel value and pick the one that suits the parameter combinations it has at hand.

Thoughts?

You might say, that a better design of the URI space solves this, by simply making the parameters optional query parameters of a single form. However, then the capabilities of json-home would seriously limit a designers 'control' over the URI space and probably conflict with legacy issues she cannot solve.

Or, maybe the guy writing the json-home has no control over the source code (yeah, its me :-)

Jan

[1] The design here is out of the question, its legacy systems and has nothing to do with customers :-)