class
Analyzer::Clojure::Reitit
- Analyzer::Clojure::Reitit
- Analyzer
- Reference
- Object
Overview
Reitit is data-driven: routes are a vector tree
["/prefix" {:get {...}} ["/child" {:post {...}}] ...]
rather than nested macro calls. The walker descends through
vectors, accumulating the prefix, and pulls method handlers
out of the route-data map keyed by :get/:post/etc.
Defined in:
analyzer/analyzers/clojure/reitit.crConstant Summary
-
CLOJURE_EXTENSIONS =
{".clj", ".cljc", ".cljs"} -
HTTP_METHODS =
{":get" => "GET", ":post" => "POST", ":put" => "PUT", ":patch" => "PATCH", ":delete" => "DELETE", ":head" => "HEAD", ":options" => "OPTIONS", ":trace" => "TRACE", ":connect" => "CONNECT", ":any" => "ANY"} -
PARAM_GROUPS =
{":query" => "query", ":path" => "path", ":header" => "header", ":body" => "json", ":form" => "form"} -
REITIT_SOURCE_RE =
Regex.union("reitit.", "metosin/reitit") -
Whole-file detection gate, evaluated once per candidate file.
String#matches?(PCRE2 JIT) replaces two naiveString#includes?char scans with a single pass;Regex.unionauto-escapes each literal, so it is provably equivalent to the OR-of-substrings it replaces.