- #if(!doc.query || doc.query.body.isEmpty):
+ #if(!doc.query):
#if(!doc.request):
-
#if(!doc.response):
-
This request has no query or body and returns no response (usually a HTTP 204).
#endif
#endif
#endif
- #if(doc.query && !doc.query.body.isEmpty):
+ #if(doc.query):
-
- #if(doc.query.body.fields):
-
- #for(field in doc.query.body.fields):
- #extend("doc_field"):
- #export("nonOptionalBadgeStyle", "badge-danger")
- #export("optionalBadgeStyle", "badge-secondary")
- #endextend
- #endfor
-
- #endif
+
+ #for(object in doc.query.objects):
+ #extend("doc_object"):
+ #export("nonOptionalBadgeStyle", "badge-danger")
+ #export("optionalBadgeStyle", "badge-secondary")
+ #endextend
+ #endfor
#endif
#if(doc.request):
-
+
@@ -56,7 +59,7 @@
#endif
#if(doc.response):
-
+
diff --git a/Sources/RouteDocs/DefaultDocsView/docs.leaf b/Sources/RouteDocs/DefaultDocsView/docs.leaf
index bbd6488..3d7bc09 100644
--- a/Sources/RouteDocs/DefaultDocsView/docs.leaf
+++ b/Sources/RouteDocs/DefaultDocsView/docs.leaf
@@ -1,5 +1,5 @@
-
+
@@ -11,7 +11,11 @@
API Docs
-
+
@@ -29,7 +33,9 @@
📚API Documentation
-
Each endpoint can be expanded to list the query parameters as well as request and response bodies.
+
+ Each endpoint can be expanded to list the query parameters as well as request and response bodies.
+
#extend("doc_list"):
#endextend
@@ -38,7 +44,7 @@
diff --git a/Sources/RouteDocs/DocsViewContext.swift b/Sources/RouteDocs/DocsViewContext.swift
index 6e345b6..14138b1 100644
--- a/Sources/RouteDocs/DocsViewContext.swift
+++ b/Sources/RouteDocs/DocsViewContext.swift
@@ -46,6 +46,10 @@ public struct DocsViewContext: Encodable, Sendable {
public let body: Body
}
+ public struct Query: Encodable, Sendable {
+ public let objects: Array