Liking cljdoc? Tell your friends :D

Getting Started

Installation

Add to your deps.edn:

{:deps {org.clojars.apace/atom-validator {:mvn/version "RELEASE"}}}

Or Leiningen project.clj:

[org.clojars.apace/atom-validator "RELEASE"]

Basic Usage

(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

Parsing XML

;; 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)

Validation Options

;; 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})

Entry Validation

;; 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"}]})

Error Codes

CodeDescription
:missing-idFeed/entry missing required <id>
:missing-titleFeed/entry missing required <title>
:missing-updatedFeed/entry missing required <updated>
:invalid-dateDate not in RFC 3339 format
:stale-feed-updatedFeed <updated> older than newest entry
:day-of-week-mismatchTitle mentions wrong day of week
:invalid-url-hostURL has suspicious/invalid hostname

Next Steps

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close