aboutsummaryrefslogtreecommitdiff
path: root/src/endpoint.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/endpoint.lisp')
-rw-r--r--src/endpoint.lisp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/endpoint.lisp b/src/endpoint.lisp
index 00f681f..4ec68b6 100644
--- a/src/endpoint.lisp
+++ b/src/endpoint.lisp
@@ -356,6 +356,12 @@ the ;."
:note "Error during the parsing of the body.")))))))
+
+(defun apply-slot-value-mappers (class initargs)
+ (loop :for (arg value) :on initargs :by #'cddr
+ :collect arg
+ :collect (slot-value-mapper class arg value)))
+
(defun instantiate-endpoint (class args)
"This attempts to instantiate CLASS, filling slots found in ARGS by
searching for their values in the hunchentoot:*request*.
@@ -371,8 +377,10 @@ the ;."
(body-args
(extract-initargs args (collect-body class))))
(apply #'make-instance class
- (reduce #'merge-plists
- (list extracted-args params-args body-args)))))
+ (apply-slot-value-mappers
+ class
+ (reduce #'merge-plists
+ (list extracted-args params-args body-args))))))
(defun build-handler (class)
"Create a hunchentoot dispatch function that instantiates and handles