Skip to content
Clojure implementation of the URI Template (RFC 6570), level 4 compliant.
Clojure
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/uritemplate
test/uritemplate/test
.gitignore
.hgignore
README
project.clj
rfc6570.txt

README

# 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.
You can’t perform that action at this time.