diff OrthancFramework/Sources/RestApi/RestApi.cpp @ 4401:354ea95b294a

documenting system calls
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Dec 2020 15:13:45 +0100
parents 029366f95217
children ad646ff506d0
line wrap: on
line diff
--- a/OrthancFramework/Sources/RestApi/RestApi.cpp	Wed Dec 23 12:30:56 2020 +0100
+++ b/OrthancFramework/Sources/RestApi/RestApi.cpp	Wed Dec 23 15:13:45 2020 +0100
@@ -151,6 +151,15 @@
           throw OrthancException(ErrorCode_InternalError);
         }
 
+        std::set<std::string> uriArguments;
+        
+        for (HttpToolbox::Arguments::const_iterator
+               it = components.begin(); it != components.end(); ++it)
+        {
+          assert(it->second.empty());
+          uriArguments.insert(it->first.c_str());
+        }
+
         if (resource.HasHandler(HttpMethod_Get))
         {
           StringHttpOutput o1;
@@ -168,7 +177,7 @@
           try
           {
             ok = (resource.Handle(call) &&
-                  call.GetDocumentation().FormatOpenApi(v));
+                  call.GetDocumentation().FormatOpenApi(v, uriArguments));
           }
           catch (OrthancException&)
           {
@@ -203,7 +212,7 @@
           try
           {
             ok = (resource.Handle(call) &&
-                  call.GetDocumentation().FormatOpenApi(v));
+                  call.GetDocumentation().FormatOpenApi(v, uriArguments));
           }
           catch (OrthancException&)
           {
@@ -238,7 +247,7 @@
           try
           {
             ok = (resource.Handle(call) &&
-                  call.GetDocumentation().FormatOpenApi(v));
+                  call.GetDocumentation().FormatOpenApi(v, uriArguments));
           }
           catch (OrthancException&)
           {
@@ -273,7 +282,7 @@
           try
           {
             ok = (resource.Handle(call) &&
-                  call.GetDocumentation().FormatOpenApi(v));
+                  call.GetDocumentation().FormatOpenApi(v, uriArguments));
           }
           catch (OrthancException&)
           {
@@ -477,7 +486,8 @@
     OpenApiVisitor visitor(*this);
     
     UriComponents root;
-    root_.ExploreAllResources(visitor, root);
+    std::set<std::string> uriArguments;
+    root_.ExploreAllResources(visitor, root, uriArguments);
 
     target = Json::objectValue;