diff --git a/openflexure_microscope/api/v2/views/actions/camera.py b/openflexure_microscope/api/v2/views/actions/camera.py index b5dab436..9d66ded6 100644 --- a/openflexure_microscope/api/v2/views/actions/camera.py +++ b/openflexure_microscope/api/v2/views/actions/camera.py @@ -66,12 +66,15 @@ class CaptureAPI(ActionView): class RAMCaptureAPI(ActionView): - """ - Take a non-persistant image capture. - """ + """Take a non-persistent image capture.""" args = BasicCaptureArgs() - responses = {200: {"content_type": "image/jpeg"}} + responses = { + 200: { + "content_type": "image/jpeg", + "description": "A JPEG image, representing the capture" + } + } def post(self, args): """ diff --git a/openflexure_microscope/api/v2/views/streams.py b/openflexure_microscope/api/v2/views/streams.py index 38a781c2..a7c3805e 100644 --- a/openflexure_microscope/api/v2/views/streams.py +++ b/openflexure_microscope/api/v2/views/streams.py @@ -17,7 +17,23 @@ class MjpegStream(PropertyView): Real-time MJPEG stream from the microscope camera """ - responses = {200: {"content_type": "multipart/x-mixed-replace"}} + responses = { + 200: { + "content_type": "multipart/x-mixed-replace", + "description": ( + "An MJPEG stream of camera images.\n\n" + "This endpoint will serve JPEG images sequentially, \n" + "with each frame separated by `--frame` and a \n" + "`Content-Type: image/jpeg` header.\n" + "Using this endpoint as the `src` of an HTML `` \n" + "tag will result in the video stream displaying without \n" + "further effort.\n\n" + "If you save the stream to disk (e.g. with `curl`), be \n" + "aware that the text in between frames may confuse some \n" + "video players." + ), + } + } def get(self): """