Added simple root and swagger routes
This commit is contained in:
parent
bcfc8e6eeb
commit
6be8b0044a
5 changed files with 59 additions and 10 deletions
|
|
@ -1,9 +1,7 @@
|
|||
from openflexure_microscope.common.labthings_core.utilities import get_docstring
|
||||
from openflexure_microscope.common.labthings_core.utilities import get_docstring, get_summary
|
||||
from .schema import Schema, marshmallow, MARSHMALLOW_VERSION_INFO
|
||||
import collections.abc
|
||||
|
||||
from webargs import dict2schema as wa_dict2schema
|
||||
|
||||
import logging
|
||||
|
||||
|
||||
|
|
@ -12,9 +10,9 @@ def description_from_view(view_class):
|
|||
for method_key in ["get", "post", "put", "delete"]:
|
||||
if hasattr(view_class, method_key):
|
||||
methods.append(method_key.upper())
|
||||
brief_description = get_docstring(view_class).partition("\n")[0].strip()
|
||||
summary = get_summary(view_class)
|
||||
|
||||
d = {"methods": methods, "description": brief_description}
|
||||
d = {"methods": methods, "description": summary}
|
||||
|
||||
return d
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue