aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-02-16 16:59:59 -0600
committerColin Okay <okay@toyful.space>2022-02-16 16:59:59 -0600
commit18d67e16348f3401a694a5a8d46af79610fadf49 (patch)
treed81352580a97982343fcd3fca5037d5493fdb65b /example
parent9ee1735d9bcea68b4514da46dadd7a4ef2e3ef02 (diff)
added definitions to apps; appended definitions to generated docs
Diffstat (limited to 'example')
-rw-r--r--example/lazybones-example-docs.md19
-rw-r--r--example/lazybones-example.lisp15
2 files changed, 30 insertions, 4 deletions
diff --git a/example/lazybones-example-docs.md b/example/lazybones-example-docs.md
index 281b98c..a7dfca9 100644
--- a/example/lazybones-example-docs.md
+++ b/example/lazybones-example-docs.md
@@ -59,7 +59,7 @@ Route Variables:
- PERSON: ID of a person
-Returns a json representation of the person.
+Returns a json representation of the [Person](#person).
### GET /random/:lo:/:hi:
*text/plain*
@@ -81,4 +81,19 @@ Documented Query Parameters:
- age: An Integer
-Echo the search parameters in a nice list. \ No newline at end of file
+Echo the search parameters in a nice list.
+
+## Definitions
+
+<h3 id='#person'>Person</h3>
+
+An instance of person. As JSON, it looks like:
+
+ {
+ "NAME" : string ,
+ "OCCUPATION" : string ,
+ "ID" : integer
+ }
+
+
+
diff --git a/example/lazybones-example.lisp b/example/lazybones-example.lisp
index 88a58a1..5eb00d9 100644
--- a/example/lazybones-example.lisp
+++ b/example/lazybones-example.lisp
@@ -58,7 +58,7 @@
the \"true\" and sends a set-cookie header, setting 'testappsession'
to 'coolsessionbro'."
(print (lzb:request-body)) ; dummy implementation, prints post body to stdout
- (setf (lzb:response-cookie "testappsession") "coolsessionbro")
+ (lzb:set-response-cookie "testappsession" "coolsessionbro" :path "/" :domain "localhost")
"true")
@@ -121,6 +121,17 @@
(defendpoint* :get "/person/:person person-by-id:" ()
(:content-type "application/json") ; override the app's default content type for HTTP responses
- "Returns a json representation of the person."
+ "Returns a json representation of the [Person](#person)."
(jonathan:to-json person))
+(lzb::set-definition
+ "Person" "#person"
+ "An instance of person. As JSON, it looks like:
+
+ {
+ \"NAME\" : string ,
+ \"OCCUPATION\" : string ,
+ \"ID\" : integer
+ }
+
+")