@@ -44,6 +44,8 @@ class W3CThingDescriptionView(View):
44
44
def get (self ):
45
45
base_url = request .host_url .rstrip ("/" )
46
46
47
+ swag = current_labthing ().spec
48
+
47
49
props = {}
48
50
for key , prop in current_labthing ().properties .items ():
49
51
props [key ] = {}
@@ -52,21 +54,21 @@ def get(self):
52
54
53
55
# Look for a _propertySchema in the Property classes API SPec
54
56
prop_spec = get_spec (prop )
55
- prop_schema = prop_spec .get ("_propertySchema" )
57
+ prop_schema = convert_schema ( prop_spec .get ("_propertySchema" ), swag )
56
58
if not prop_schema :
57
59
# If prop is read-only
58
60
if hasattr (prop , "get" ) and not (
59
61
hasattr (prop , "post" ) or hasattr (prop , "put" )
60
62
):
61
- prop_schema = get_spec (prop .get ).get ("_schema" ).get (200 )
63
+ prop_schema = convert_schema ( get_spec (prop .get ).get ("_schema" ).get (200 ), swag )
62
64
# If prop is write-only
63
65
elif not hasattr (prop , "get" ) and (
64
66
hasattr (prop , "post" ) or hasattr (prop , "put" )
65
67
):
66
68
if hasattr (prop , "post" ):
67
- prop_schema = get_spec (prop .post ).get ("_params" )
69
+ prop_schema = convert_schema ( get_spec (prop .post ).get ("_params" ), swag )
68
70
elif hasattr (prop , "put" ):
69
- prop_schema = get_spec (prop .put ).get ("_params" )
71
+ prop_schema = convert_schema ( get_spec (prop .put ).get ("_params" ), swag )
70
72
else :
71
73
prop_schema = {}
72
74
0 commit comments