From a8b1efb7cd8163b8372b64ecb9da048945d79166 Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 25 Jul 2021 01:23:44 +0100 Subject: [PATCH] Removed openapi endpoints (now in LabThings) --- openflexure_microscope/api/app.py | 2 -- .../api/v2/views/__init__.py | 1 - openflexure_microscope/api/v2/views/docs.py | 23 ------------------- 3 files changed, 26 deletions(-) delete mode 100644 openflexure_microscope/api/v2/views/docs.py diff --git a/openflexure_microscope/api/app.py b/openflexure_microscope/api/app.py index 3ad46e20..444fc7fc 100644 --- a/openflexure_microscope/api/app.py +++ b/openflexure_microscope/api/app.py @@ -156,8 +156,6 @@ labthing.add_view( views.NestedConfigurationProperty, "/instrument/configuration/" ) labthing.add_root_link(views.ConfigurationProperty, "instrumentConfiguration") -labthing.add_view(views.APISpecJSONView, "/docs/swagger.json") -labthing.add_view(views.APISpecYAMLView, "/docs/swagger.yaml") # Attach stage resources labthing.add_view(views.StageTypeProperty, "/instrument/stage/type") diff --git a/openflexure_microscope/api/v2/views/__init__.py b/openflexure_microscope/api/v2/views/__init__.py index 5e53611f..5771e204 100644 --- a/openflexure_microscope/api/v2/views/__init__.py +++ b/openflexure_microscope/api/v2/views/__init__.py @@ -1,7 +1,6 @@ from .actions import enabled_root_actions from .camera import * from .captures import * -from .docs import * from .instrument import * from .stage import * from .streams import * diff --git a/openflexure_microscope/api/v2/views/docs.py b/openflexure_microscope/api/v2/views/docs.py deleted file mode 100644 index 8d2ce264..00000000 --- a/openflexure_microscope/api/v2/views/docs.py +++ /dev/null @@ -1,23 +0,0 @@ -from flask import Response -from labthings import current_labthing -from labthings.views import View - - -class APISpecJSONView(View): - """OpenAPI v3 documentation - - A JSON document containing an API description in OpenAPI format - """ - - def get(self): - return current_labthing().spec.to_dict() - - -class APISpecYAMLView(View): - """OpenAPI v3 documentation - - A YAML document containing an API description in OpenAPI format - """ - - def get(self): - return Response(current_labthing().spec.to_yaml(), mimetype="text/yaml")