diff OrthancFramework/Sources/RestApi/RestApiHierarchy.h @ 4399:80fd140b12ba

New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Dec 2020 12:21:03 +0100
parents a01b1c9cbef4
children 029366f95217
line wrap: on
line diff
--- a/OrthancFramework/Sources/RestApi/RestApiHierarchy.h	Tue Dec 22 09:39:06 2020 +0100
+++ b/OrthancFramework/Sources/RestApi/RestApiHierarchy.h	Wed Dec 23 12:21:03 2020 +0100
@@ -45,7 +45,7 @@
     public:
       Resource();
 
-      bool HasHandler(HttpMethod method) const;
+      bool HasMethod(HttpMethod method) const;
 
       void Register(RestApiGetCall::Handler handler);
 
@@ -76,7 +76,9 @@
 
       virtual bool Visit(const Resource& resource,
                          const UriComponents& uri,
-                         const HttpToolbox::Arguments& components,
+                         bool hasTrailing,
+                         // The two arguments below are empty if using "ExploreAllResources()"
+                         const HttpToolbox::Arguments& uriComponents,
                          const UriComponents& trailing) = 0;
     };
 
@@ -87,7 +89,7 @@
     Resource  handlers_;
     Children  children_;
     Children  wildcardChildren_;
-    Resource  universalHandlers_;
+    Resource  handlersWithTrailing_;
 
     static RestApiHierarchy& AddChild(Children& children,
                                       const std::string& name);
@@ -135,5 +137,8 @@
 
     void GetAcceptedMethods(std::set<HttpMethod>& methods,
                             const UriComponents& uri);
+
+    void ExploreAllResources(IVisitor& visitor,
+                             const UriComponents& path) const;
   };
 }