File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 99from collections import Mapping
1010
1111
12- def update_spec (obj , spec ):
12+ def update_spec (obj , spec : dict ):
13+ """Add API spec data to an object
14+
15+ Args:
16+ obj: Python object
17+ spec (dict): Dictionary of API spec data to add
18+ """
1319 obj .__apispec__ = obj .__dict__ .get ("__apispec__" , {})
1420 rupdate (obj .__apispec__ , spec )
1521 return obj .__apispec__ or {}
1622
1723
1824def get_spec (obj ):
25+ """Get the __apispec__ dictionary created by LabThings decorators for a particular object
26+
27+ Args:
28+ obj: Python object
29+
30+ Returns:
31+ dict: API spec dictionary. Returns empty dictionary if no spec is found.
32+ """
1933 obj .__apispec__ = obj .__dict__ .get ("__apispec__" , {})
2034 return obj .__apispec__ or {}
2135
You can’t perform that action at this time.
0 commit comments