Applications and resources
Public
hoplite.core/app tags a map as an application. The map is immutable application data, not an imperative server builder.
(h/app {:name "catalog" :resources [...]})Passing a callable instead of a map creates a catch-all application with one ANY /*path route:
(h/app #'handler)Resource trees
Section titled “Resource trees”Resources are nested vectors. Paths must be empty or begin with /; child paths are joined to their parent.
["/users" {:get {:handler #'list-users}} ["/:id" {:get {:handler #'get-user} :delete {:handler #'delete-user}}]]At build time, Hoplite flattens the tree into method/path/handler records. An application with no operations is rejected.
Operation fields
Section titled “Operation fields”| Field | Required | Purpose |
|---|---|---|
:handler |
Yes | Callable or Var resolved for the route |
:name |
No | Stable operation name |
:summary |
No | Human-readable description used by OpenAPI output |
:route/adapter |
No | :raw, :request (default), or :request+hta; overrides the application default |
Validation
Section titled “Validation”Hoplite rejects relative resource paths, operations without handlers, non-callable handlers, empty applications, duplicate application IDs, and ambiguous default applications sharing a port.