> On 25 Aug 2015, at 13:27, Bassbouss, Louay <louay.bassbouss@fokus.fraunhofer.de> wrote:
> protocols is an object or an array. Can you check the JSON-syntax of your new suggestion.
Thanks for spotting the error, it should have been written as:
{
“protocols” : [
{
“name” : “ws”,
"uri" : "ws://www.example.com:8080/webofthings”
},
{
“name” : “http”,
"uri" : "http://www.example.com:8888/webofthings"
}
]
}
One advantage of my original proposal is that a) it is more succinct, and b) it precludes having more than one entry for each protocol. With the idea of allowing for metadata unrelated to protocols it would become:
{
“protocols” : {
“ws” : {
"uri" : "ws://www.example.com:8080/webofthings”,
“priority” : 1
},
“http” : {
"uri" : "http://www.example.com:8888/webofthings”,
“priority” : 2
}
}
}
The code to process this would scan all of the protocols looking for the compatible protocol with the highest priority. Both approaches are roughly equivalent, except that the second prevents duplicate entries and having explicit priorities allows for partial ordering, but I don’t know how important these two points could be.
—
Dave Raggett <dsr@w3.org <mailto:dsr@w3.org>>