https://github.com/dfa1/uritemplate
Clojure implementation of the URI Template (RFC 6570), level 4 compliant.
https://github.com/dfa1/uritemplate
clojure rfc-6570 uri-template
Last synced: 20 days ago
JSON representation
Clojure implementation of the URI Template (RFC 6570), level 4 compliant.
- Host: GitHub
- URL: https://github.com/dfa1/uritemplate
- Owner: dfa1
- Created: 2019-09-05T06:32:02.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-05T06:32:25.000Z (almost 7 years ago)
- Last Synced: 2025-03-11T15:46:25.281Z (over 1 year ago)
- Topics: clojure, rfc-6570, uri-template
- Language: Clojure
- Homepage:
- Size: 103 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
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.