aboutsummaryrefslogtreecommitdiff
path: root/src/endpoint.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/endpoint.lisp')
-rw-r--r--src/endpoint.lisp34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/endpoint.lisp b/src/endpoint.lisp
index 8189572..eeb536e 100644
--- a/src/endpoint.lisp
+++ b/src/endpoint.lisp
@@ -373,17 +373,24 @@ the ;."
1. in path extractors
2. in query parameters
3. in the request body."
- (let ((extracted-args
- (process-extractors class))
- (params-args
- (extract-initargs args (http:get-parameters*)))
- (body-args
- (extract-initargs args (collect-body class))))
- (apply #'make-instance class
+ (debug-print :instantiate-endpoint (class-name class) args)
+ (let* ((extracted-args
+ (process-extractors class))
+
+ (params-args
+ (extract-initargs args (http:get-parameters*)))
+
+ (body-args
+ (extract-initargs args (collect-body class)))
+
+ (collected-args
(apply-slot-value-mappers
class
(reduce #'merge-plists
- (list extracted-args params-args body-args))))))
+ (list extracted-args params-args body-args)))))
+
+ (debug-print :initargs-collected collected-args)
+ (apply #'make-instance class collected-args)))
(defun build-handler (class)
"Create a hunchentoot dispatch function that instantiates and handles
@@ -397,9 +404,14 @@ the ;."
(content-type
(content-type class)))
(lambda ()
- (check-request-compliance class)
- (setf (http:content-type*) content-type)
- (handle (instantiate-endpoint class init-slots)))))
+ (let ((*debug-indent* 0))
+ (debug-print
+ (http:request-method*)
+ (http:request-uri*)
+ :dispatched-on (class-name class))
+ (check-request-compliance class)
+ (setf (http:content-type*) content-type)
+ (handle (instantiate-endpoint class init-slots))))))
(defun create-class-dispatcher (class)
"Creates a function that dispatches a handler function if a request