diff options
author | Colin Okay <okay@toyful.space> | 2022-02-08 15:19:12 -0600 |
---|---|---|
committer | Colin Okay <okay@toyful.space> | 2022-02-08 15:19:12 -0600 |
commit | 2742fd7bc38999287b9ee7de9f3b94f8d1ac5cc0 (patch) | |
tree | 20c2c8d661c068b63edb7786c1b646b76c2c21ba | |
parent | 904caeeeb292f56067a545a19a326f77e1cd9ec9 (diff) |
changed route format in documentation, updated example documentation
-rw-r--r-- | example/lazybones-test-docs.md | 4 | ||||
-rw-r--r-- | lazybones-documentation.lisp | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/example/lazybones-test-docs.md b/example/lazybones-test-docs.md index e7133f1..12effa8 100644 --- a/example/lazybones-test-docs.md +++ b/example/lazybones-test-docs.md @@ -36,7 +36,7 @@ Dummy login endpoint for returning a session cookie. Always returns the "true" and sends a set-cookie header, setting 'testappsession' to 'coolsessionbro'. -### GET /person/:person person-by-id: +### GET /person/:person: *application/json* Route Variables: @@ -59,7 +59,7 @@ Echo the search parameters in a nice list, but also has a post-body Echo the search parameters in a nice list. -### GET /search/:category to-int: +### GET /search/:category: *text/plain* Route Variables: diff --git a/lazybones-documentation.lisp b/lazybones-documentation.lisp index c7cd591..b64ec63 100644 --- a/lazybones-documentation.lisp +++ b/lazybones-documentation.lisp @@ -25,7 +25,7 @@ (dolist (ep (sorted-endpoints endpoints)) (with-slots (method content-type route authorizer endpoint-documentation) ep newline - (princ "### ") (princ method) (princ " ") (princ route) + (princ "### ") (princ method) (princ " ") (princ (make-route-presentable route)) (terpri) (princ "*") (princ (if content-type content-type default-content-type )) @@ -71,3 +71,6 @@ (defun route-var-value-parser (ep var) (second (assoc var (remove-if-not #'consp (endpoint-dispatch-pattern ep))))) + +(defun make-route-presentable (routestring) + (ppcre:regex-replace-all " [a-z0-9A-Z\-]+:" routestring ":")) |