First draft of auto-Swagger
This commit is contained in:
parent
99d0d0055e
commit
6d7921e8b4
8 changed files with 205 additions and 21 deletions
|
|
@ -1,4 +1,10 @@
|
|||
from openflexure_microscope.common.labthings_core.utilities import get_docstring
|
||||
from .schema import Schema, marshmallow, MARSHMALLOW_VERSION_INFO
|
||||
import collections.abc
|
||||
|
||||
from webargs import dict2schema as wa_dict2schema
|
||||
|
||||
import logging
|
||||
|
||||
|
||||
def description_from_view(view_class):
|
||||
|
|
@ -11,3 +17,12 @@ def description_from_view(view_class):
|
|||
d = {"methods": methods, "description": brief_description}
|
||||
|
||||
return d
|
||||
|
||||
|
||||
def rupdate(d, u):
|
||||
for k, v in u.items():
|
||||
if isinstance(v, collections.abc.Mapping):
|
||||
d[k] = rupdate(d.get(k, {}), v)
|
||||
else:
|
||||
d[k] = v
|
||||
return d
|
||||
Loading…
Add table
Add a link
Reference in a new issue