docuri icon indicating copy to clipboard operation
docuri copied to clipboard

Use colon as _id property separator

Open tlvince opened this issue 10 years ago • 4 comments

Per https://github.com/eHealthAfrica/couchdb-best-practices/issues/39. Perhaps even make it configurable?

tlvince avatar May 17 '15 11:05 tlvince

Since : was used for named params before, this change requires a bigger effort and may introduce breaking changes.

I would suggest that we use Template Strings for named params.

I think this change would make docuri less intuitive, since it breaks the router analogy. But the project can also yield when this is taken as an incentive to rethink the api.

jo avatar May 18 '15 12:05 jo

It seems the problems with / are realistic enough to do something about it. But the user experience of describing routes as URL routes is very important. Among other things, it intuitively suggests a good design for routes, mirroring REST practices.

Here's a suggestions: perhaps we do not need to actually have the API and the implementation to match. After all, if one uses docuri properly, the use of slashes is a purely internal detail. Consider the API that uses slashes: docuri.route('/items/:id'), but actually produces :items:23 when asked to build a path. This is a controversial idea, let me know what you think.

denis-sokolov avatar Jun 03 '15 13:06 denis-sokolov

I like it!

jo avatar Jun 03 '15 13:06 jo

+1

tlvince avatar Jun 03 '15 14:06 tlvince