changeset 4407:2412601cd24b

cont openapi
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 24 Dec 2020 17:44:52 +0100
parents 4cb9f66a1c7c
children d2bfadc2948b
files OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp	Thu Dec 24 17:32:19 2020 +0100
+++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp	Thu Dec 24 17:44:52 2020 +0100
@@ -2191,8 +2191,20 @@
 
   static void ExtractPdf(RestApiGetCall& call)
   {
+    if (call.IsDocumentation())
+    {
+      call.GetDocumentation()
+        .SetTag("Instances")
+        .SetSummary("Get embedded PDF")
+        .SetDescription("Get the PDF file that is embedded in one DICOM instance. "
+                        "If the DICOM instance doesn't contain the `EncapsulatedDocument` tag or if the "
+                        "`MIMETypeOfEncapsulatedDocument` tag doesn't correspond to the PDF type, a `404` HTTP error is raised.")
+        .SetUriArgument("id", "Orthanc identifier of the instance interest")
+        .AddAnswerType(MimeType_Pdf, "PDF file");
+      return;
+    }
+
     const std::string id = call.GetUriComponent("id", "");
-
     std::string pdf;
     ServerContext::DicomCacheLocker locker(OrthancRestApi::GetContext(call), id);