diff OrthancFramework/Sources/RestApi/RestApi.cpp @ 4417:a4518adede59

openapi for plugins and jobs
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 28 Dec 2020 17:40:35 +0100
parents d928dfcacb4b
children a7d72378e1cb
line wrap: on
line diff
--- a/OrthancFramework/Sources/RestApi/RestApi.cpp	Mon Dec 28 16:49:17 2020 +0100
+++ b/OrthancFramework/Sources/RestApi/RestApi.cpp	Mon Dec 28 17:40:35 2020 +0100
@@ -359,8 +359,10 @@
       virtual bool HandleCall(RestApiCall& call,
                               const std::set<std::string> uriArgumentsNames) ORTHANC_OVERRIDE
       {
+        const std::string path = Toolbox::FlattenUri(call.GetFullUri());
+
         Json::Value v;
-        if (call.GetDocumentation().FormatOpenApi(v, uriArgumentsNames))
+        if (call.GetDocumentation().FormatOpenApi(v, uriArgumentsNames, path))
         {
           std::string method;
           
@@ -386,8 +388,6 @@
               throw OrthancException(ErrorCode_ParameterOutOfRange);
           }
           
-          const std::string path = Toolbox::FlattenUri(call.GetFullUri());
-
           if ((paths_.isMember(path) &&
                paths_[path].type() != Json::objectValue) ||
               paths_[path].isMember(method))