Mercurial > hg > orthanc
diff OrthancFramework/Sources/RestApi/RestApiCallDocumentation.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 | b50410d0e98c |
children | 83371ccdfe80 |
line wrap: on
line diff
--- a/OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp Mon Dec 28 16:49:17 2020 +0100 +++ b/OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp Mon Dec 28 17:40:35 2020 +0100 @@ -307,7 +307,8 @@ bool RestApiCallDocumentation::FormatOpenApi(Json::Value& target, - const std::set<std::string>& expectedUriArguments) const + const std::set<std::string>& expectedUriArguments, + const std::string& uri) const { if (summary_.empty() && description_.empty()) @@ -362,6 +363,13 @@ p["description"] = field->second.GetDescription(); schema["properties"][field->first] = p; } + + if (!it->second.empty() && + answerFields_.size() > 0) + { + LOG(WARNING) << "The JSON description will not be visible if the fields of the JSON request are detailed: " + << EnumerationToString(method_) << " " << uri; + } } } } @@ -383,7 +391,14 @@ TypeToSchema(p, field->second.GetType()); p["description"] = field->second.GetDescription(); schema["properties"][field->first] = p; - } + } + + if (!it->second.empty() && + answerFields_.size() > 0) + { + LOG(WARNING) << "The JSON description will not be visible if the fields of the JSON answer are detailed: " + << EnumerationToString(method_) << " " << uri; + } } }