Add to your deps.edn:
{:deps {org.clojars.apace/atom-validator {:mvn/version "RELEASE"}}}
Or Leiningen project.clj:
[org.clojars.apace/atom-validator "RELEASE"]
(require '[atom-validator.core :as v])
;; Validate a feed map
(v/validate-feed {:id "urn:uuid:feed-1"
:title "My Blog"
:updated "2026-06-19T12:00:00Z"
:entries []})
;; => {:valid? true :errors [] :warnings [] :feed {...}}
;; Quick validity check
(v/valid? feed)
;; => true
;; Parse from XML string
(def feed (v/parse-feed "<feed xmlns='http://www.w3.org/2005/Atom'>...</feed>"))
;; Parse from URL
(def feed (v/parse-feed (slurp "https://example.com/feed.atom")))
;; Then validate
(v/validate-feed feed)
;; Disable semantic checks (day-of-week validation)
(v/validate-feed feed {:semantic? false})
;; Strict mode: treat warnings as errors
(v/validate-feed feed {:strict? true})
;; Validate individual entries
(v/validate-entry {:id "urn:uuid:entry-1"
:title "Hello World"
:updated "2026-06-19T00:00:00Z"
:links [{:href "https://example.com/post/1" :rel "alternate"}]})
| Code | Description |
|---|---|
:missing-id | Feed/entry missing required <id> |
:missing-title | Feed/entry missing required <title> |
:missing-updated | Feed/entry missing required <updated> |
:invalid-date | Date not in RFC 3339 format |
:stale-feed-updated | Feed <updated> older than newest entry |
:day-of-week-mismatch | Title mentions wrong day of week |
:invalid-url-host | URL has suspicious/invalid hostname |
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |