Regarding URI Templates in queries section

13 views
Skip to first unread message

Lakshmanan Subbiah

unread,
Mar 29, 2017, 9:41:17 AM3/29/17
to Collection+JSON
Hi All,
   I am having a doubt regarding URI Templates and implementing them in Collection+JSON 
   
   Ref:https://github.com/mamund/collection-json/blob/master/extensions/uri-templates.md . In the above reference, The Uri template is provided for the path param. what if I need to provide URI Template for query Parameters and also those parameters are not mandatory and can contain any number of given param. 
  I thought of providing the Queries like this,

        {
    “ queries":[
                 "encoding" : "uri-template",
        "href" : "http://example.org/posts",
        "rel" : "search",
        “params”:[
                   {
                    “name”:”id”,
                    “value”:””,
                    “appendURL”:”&id={id}"
                    } 
               ]
          ]

Please provide your valuable suggestions. 

Thanks & Regards
Lakshmanan

mca

unread,
Mar 29, 2017, 10:35:42 AM3/29/17
to collect...@googlegroups.com
the URI templates extension is not governed by Cj spec and if you have an implementation for templates that makes for sense for you, feel free to work it up and submit for consideration here.

FWIW, what you're outlining in this thread looks quite a bit like the design of the queries objects in the Cj spec. I would suggest using the queries design already in the Cj spec unless you're finding something unworkable for your needs.


--
You received this message because you are subscribed to the Google Groups "Collection+JSON" group.
To unsubscribe from this group and stop receiving emails from it, send an email to collectionjson+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages