RESTED icon indicating copy to clipboard operation
RESTED copied to clipboard

Make Links clickable and support rfc6570 uritemplates

Open dschulten opened this issue 8 years ago • 4 comments

Links starting with http:// or https:// in a json response should be clickable and become the next request url when clicked. If the clicked link is a URI Template (rfc6570), rested should show a panel to enter the data and store them for the next request.

The template with double moustaches does not follow any standard, it should be kept for compatibility.

dschulten avatar Mar 26 '17 07:03 dschulten

I wasn't aware of any URI template RFC, thanks for that. The double mustaches are mostly just there because they were easy to use with angular.

Right now I'm focused on getting 2.0 out of the gates, but I'll probably have a look at this after the fact. This library may be useful

eliihen avatar Mar 26 '17 11:03 eliihen

I just have one concern with rfc6570. What happens if I have a link like example.com/get_json?json={"foo":"bar"}? People would most likely be very confused if the extension simply stripped it away.

I think it would be best if unknown expansion keys were simply left alone. The library I linked does not do this, it removes any unknown expansions.

eliihen avatar Jun 23 '17 07:06 eliihen

the value of json has to be urlencoded, so the server receives the following: /get_json?json=%7B%22foo%22%3A%22bar%22%7D If you enter your url in the address bar, the browser encodes the url as shown above

An api containing links would have to encode the link in the same way to make it a valid dereferenceable url. Hence, if someone clicked it in rested, you wouldn't find a curly bracket, no risk to mistake a link for a uritemplate.

dschulten avatar Jun 23 '17 20:06 dschulten

👍

dschulten avatar Nov 23 '17 11:11 dschulten