-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
32 lines (22 loc) · 871 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# uritemplate
Clojure implementation of the URI Template (RFC 6570), level 4 compliant.
## Usage
user=> (let [bitbucket (uritemplate "http://bitbucket.org/{user}/{project}")]
(bitbucket {:user "dfa" :project "uritemplate"}))
http://bitbucket.org/dfa/uritemplate
user=>
## Todo
- improve error reporting:
+ missing } in templates
+ empty templates
+ prefix together with explode
- uriparser?
(let [example-parser (uri-parser "http://example.com/{role}/{user}")]
(example-parser "http://example.com/admin/dfa")) ; yields {:role "admin"
:user "user" }
## Inspired by
http://code.google.com/p/uri-templates/
http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/web/util/UriTemplate.html
## License
Copyright (C) 2011-2014 Davide Angelocola
Distributed under the Eclipse Public License, the same as Clojure.