summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-03-26 15:15:20 -0500
committerColin Okay <okay@toyful.space>2022-03-26 15:15:20 -0500
commita4b0884baf23146ebb64389bdb8a829b09e46d09 (patch)
tree85d93cc9b6afb2fe95909cb555ebb0f757c785d1
parentc9ce14c6c73458b53b4ea1c334afda31f5b23ed9 (diff)
[bugfix] uri formatting string; part 1
-rw-r--r--lazybones-client.lisp19
1 files changed, 11 insertions, 8 deletions
diff --git a/lazybones-client.lisp b/lazybones-client.lisp
index 027ed2f..b17dacc 100644
--- a/lazybones-client.lisp
+++ b/lazybones-client.lisp
@@ -36,7 +36,7 @@ endpoint EP."
do (princ term)
when (listp term)
do (princ (car term))
- when more
+ when (and more (plusp (length term)))
do (princ "-"))))
(defun endpoint-defun-route-var-names (ep)
@@ -79,12 +79,15 @@ for making requests to endpoint EP."
embedded into the body of a defun for making requests to the
endpoint EP. It is desienged to be passed to FORMAT, where query
paramters are substituted into the string, if they exist."
- (str:join "&"
- (loop for varname in (endpoint-defun-query-var-names ep)
- collect (with-output-to-string (*standard-output*)
- (princ "~:[~;")
- (princ (string-upcase varname))
- (princ "=~a~]")))))
+ (with-output-to-string (*standard-output*)
+ (loop
+ for first = t then nil
+ for varname in (endpoint-defun-query-var-names ep)
+ do
+ (princ "~:[~;")
+ (unless first (princ #\&))
+ (princ (string-upcase varname))
+ (princ "=~a~]"))))
(defun endpoint-defun-dexador-request-uri (app ep)
"Returns a string representation of code that generates a URI for
@@ -108,7 +111,7 @@ for making requests to endpoint EP."
for making requests to the endpoint EP in the app APP."
(format
nil
- "(dexador:~a~%~s~%~{~a~%~})"
+ "(dexador:~a~%~a~%~{~a~%~})"
(string-downcase (symbol-name (lazybones::endpoint-method ep)))
(endpoint-defun-dexador-request-uri app ep)
'(":content %body%"