From ce69e1b3c4846b17ca10406e2e7e08d9b46fc7ec Mon Sep 17 00:00:00 2001 From: colin Date: Sun, 12 May 2024 09:31:24 -0700 Subject: Fix: tweaking defendpoint --- src/defendpoint.lisp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/defendpoint.lisp b/src/defendpoint.lisp index 2e87874..872c336 100644 --- a/src/defendpoint.lisp +++ b/src/defendpoint.lisp @@ -1,3 +1,5 @@ +(in-package :weekend) + ;;; DEFENDPOINT (defun path-part-p (part) @@ -68,6 +70,7 @@ PART is either documentation authenticate authorize) + (loop :for super :in supers :do (mop:ensure-finalized (find-class super))) (setf var (or var (gensym "REQ-"))) (setf metaclass (or metaclass 'endpoint)) (let* ((slot-defs @@ -93,11 +96,12 @@ PART is either (list (list :metaclass metaclass)) (list (cons :method method)) (list (list* :route-parts route-parts)) - (list (cons :content-type return)) + (when return + (list (cons :content-type return))) (when extractors (list (list* :extractors extractors))) (when documentation - (list (list :documentation documentation)))))) + (list (cons :documentation documentation)))))) `(progn (defclass ,name ,supers ,slot-defs @@ -121,11 +125,11 @@ PART is either (argot:deflanguage defendpoint () ( - :match (:seq (:@ name (:item)) + :match (:seq (:@ name ) (:@ supers (:? )) (:@ method ) (:@ pathspec ) - (:@ return ) + (:@ return (:? )) (:@ params (:? )) (:@ props (:? )) (:@ options (:*