aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2024-05-12 09:53:55 -0700
committercolin <colin@cicadas.surf>2024-05-12 09:53:55 -0700
commit5cce96a68272bab5204b806116be98bee051a97d (patch)
tree09d1d4dfba1138b477f0125ec053de5626973700 /src
parentce69e1b3c4846b17ca10406e2e7e08d9b46fc7ec (diff)
Add: defendpoint example; Fix: tweak defendpoint docstring
Diffstat (limited to 'src')
-rw-r--r--src/defendpoint.lisp26
-rw-r--r--src/package.lisp3
2 files changed, 16 insertions, 13 deletions
diff --git a/src/defendpoint.lisp b/src/defendpoint.lisp
index 872c336..0ac9ec9 100644
--- a/src/defendpoint.lisp
+++ b/src/defendpoint.lisp
@@ -60,8 +60,9 @@ PART is either
(getf kwargs :documentation "")))))
(defun expand-endpoint-class
- (name method pathspec handle return
+ (name method pathspec handle
&key
+ return
supers
parameters
properties
@@ -129,9 +130,9 @@ PART is either
(:@ supers (:? <supers>))
(:@ method <method>)
(:@ pathspec <pathspec>)
- (:@ return (:? <return>))
- (:@ params (:? <parameters>))
- (:@ props (:? <properties>))
+ ; (:@ return (:? <return>))
+; (:@ params (:? <parameters>))
+; (:@ props (:? <properties>))
(:@ options (:* <option>))
(:@ handle <handle>)
(:eof))
@@ -140,10 +141,10 @@ PART is either
method
pathspec
handle
- return
+; return
:supers supers
- :parameters params
- :properties props
+; :parameters params
+; :properties props
(a:alist-plist options)))
(<supers>
:match (:seq (:or= :using :extends) (:+ <classname>))
@@ -154,7 +155,7 @@ PART is either
(<method>
:match (:or= :get :post :put :patch :head :delete))
(<pathspec>
- :match (:seq (:or= :to :from :at :route) (:+ <pathpart>))
+ :match (:seq (:or= :to :route) (:+ <pathpart>))
:then second)
(<pathpart>
:match (:item)
@@ -162,25 +163,26 @@ PART is either
:note "REGEX or (KWD REGEX &optional PARSER)")
(<parameters>
:match (:seq (:= :parameters) (:+ <param>))
- :then second)
+ :then (cons :parameters (second <parameters>)))
(<param>
:match (:item)
:if parameter-spec-p
:note "(NAME TYPE &optional DOCSTRING)")
(<properties>
:match (:seq (:= :properties) (:+ <prop>))
- :then second)
+ :then (cons :properties (second <properties>)))
(<prop>
:match (:item)
:if property-spec-p
:note "(NAME TYPE &key DEFAULT DOCSTRING)")
(<option>
- :match (:or <doc> <metaclass> <var>
+ :match (:or <return> <parameters> <properties>
+ <doc> <metaclass> <var>
<authenticate> <authorize>))
(<return>
:match (:seq (:= :returns) (:@ mimetype (:item)))
:if (stringp mimetype)
- :then second
+ :then (cons :return (second <return>))
:note "The mimetype returned from this endpoint.")
(<doc>
:match (:seq (:= :documentation) (:@ doc (:item)))
diff --git a/src/package.lisp b/src/package.lisp
index bb74e5f..e71c71b 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -32,7 +32,8 @@
;; METACLASS
#:endpoint
#:register-body-parser
-
+ #:defendpoint
+
;; DOCGEN
#:print-route-documentation
#:print-all-route-documentation))