@@ -16,7 +16,6 @@ def property_of(
16
16
description = None ,
17
17
semtype = None ,
18
18
schema = fields .Field (),
19
- _legacy = False , # Old structure where POST is used to write property
20
19
):
21
20
22
21
# Create a class name
@@ -52,10 +51,6 @@ def _update(self, args):
52
51
if type (getattr (property_object , property_name )) is dict :
53
52
generated_class .put = _update
54
53
generated_class .methods .add ("PUT" )
55
- # If legacy mode, use POST to write property
56
- elif _legacy :
57
- generated_class .post = _write
58
- generated_class .methods .add ("POST" )
59
54
# Normally, use PUT to write property
60
55
else :
61
56
generated_class .put = _write
@@ -72,11 +67,11 @@ def _update(self, args):
72
67
# Apply semantic type last, to ensure this is always used
73
68
if semtype :
74
69
if isinstance (semtype , str ):
75
- generated_class = Semtype ( semtype )( generated_class )
70
+ generated_class . semtype = semtype
76
71
elif isinstance (semtype , Semantic ):
77
72
generated_class = semtype (generated_class )
78
73
else :
79
- logging . error (
74
+ raise TypeError (
80
75
"Unsupported type for semtype. Must be a string or Semantic object"
81
76
)
82
77
return generated_class
@@ -125,7 +120,7 @@ def _post_with_args(self, args):
125
120
elif isinstance (semtype , Semantic ):
126
121
generated_class = semtype (generated_class )
127
122
else :
128
- logging . error (
123
+ raise TypeError (
129
124
"Unsupported type for semtype. Must be a string or Semantic object"
130
125
)
131
126
0 commit comments