# HG changeset patch
# User Sebastien Jodogne <s.jodogne@gmail.com>
# Date 1608828792 -3600
# Node ID d2bfadc2948b84c65a7dd86dd18c679dc9b79e44
# Parent  2412601cd24bc9a6e021e6966e8ea441d35bbb6e
cont openapi

diff -r 2412601cd24b -r d2bfadc2948b OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp	Thu Dec 24 17:44:52 2020 +0100
+++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp	Thu Dec 24 17:53:12 2020 +0100
@@ -1201,6 +1201,28 @@
   template <bool GzipCompression>
   static void GetRawFrame(RestApiGetCall& call)
   {
+    if (call.IsDocumentation())
+    {
+      call.GetDocumentation()
+        .SetTag("Instances")
+        .SetSummary("Access raw frame" + std::string(GzipCompression ? " (compressed)" : ""))
+        .SetDescription("Access the raw content of one individual frame of the DICOM instance of interest, "
+                        "bypassing image decoding. This is notably useful to access the source files "
+                        "in compressed transfer syntaxes." +
+                        std::string(GzipCompression ? " The image is compressed using gzip" : ""))
+        .SetUriArgument("frame", RestApiCallDocumentation::Type_Number, "Index of the frame (starts at `0`)");
+
+      if (GzipCompression)
+      {
+        call.GetDocumentation().AddAnswerType(MimeType_Gzip, "The raw frame, compressed using gzip");
+      }
+      else
+      {
+        call.GetDocumentation().AddAnswerType(MimeType_Binary, "The raw frame");
+      }
+      return;
+    }
+    
     std::string frameId = call.GetUriComponent("frame", "0");
 
     unsigned int frame;