diff options
author | Colin Okay <okay@toyful.space> | 2022-02-16 16:59:59 -0600 |
---|---|---|
committer | Colin Okay <okay@toyful.space> | 2022-02-16 16:59:59 -0600 |
commit | 18d67e16348f3401a694a5a8d46af79610fadf49 (patch) | |
tree | d81352580a97982343fcd3fca5037d5493fdb65b /lazybones.lisp | |
parent | 9ee1735d9bcea68b4514da46dadd7a4ef2e3ef02 (diff) |
added definitions to apps; appended definitions to generated docs
Diffstat (limited to 'lazybones.lisp')
-rw-r--r-- | lazybones.lisp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lazybones.lisp b/lazybones.lisp index fe2ebc3..c7be8d8 100644 --- a/lazybones.lisp +++ b/lazybones.lisp @@ -57,6 +57,13 @@ :initarg :vsn :initarg :version :initform "0.0.1" :type string) + (definitions + :accessor app-definitions + :initform (make-hash-table :test 'equal) + :documentation "Definitions are used in the generation of + documentation. They can be linked to from docstrings of + endpoints. Used to provide additional documentation for, e.g., + JSON object specifications for post bodies or return types.") (authorizer :accessor request-authorizer :initarg :auth @@ -379,3 +386,13 @@ making a new one if not." (signal 'http-error :content content :code code)) +;;; MANAGING DEFINITIONS + +(defun set-definition (name item-id definition-text &optional (app (lazybones:app))) + "Name is a string" + (setf (gethash name (app-definitions app)) (cons item-id definition-text))) + +(defun drop-definition (name &optional (app (lazybones:app))) + "Remove definition keyed by LINK-TARGET from APP." + (remhash name (app-definitions app))) + |