@@ -42,8 +42,8 @@ def label(self):
42
42
@classmethod
43
43
def from_dict (cls , dictionary : Dict [str , Any ]):
44
44
return Option (value = dictionary ["value" ],
45
- schema_id = dictionary .get ("schemaNodeId" , [] ),
46
- feature_schema_id = dictionary .get ("featureSchemaId" , [] ),
45
+ schema_id = dictionary .get ("schemaNodeId" , None ),
46
+ feature_schema_id = dictionary .get ("featureSchemaId" , None ),
47
47
options = [
48
48
Classification .from_dict (o )
49
49
for o in dictionary .get ("options" , [])
@@ -123,10 +123,10 @@ def from_dict(cls, dictionary: Dict[str, Any]):
123
123
return Classification (
124
124
class_type = Classification .Type (dictionary ["type" ]),
125
125
instructions = dictionary ["instructions" ],
126
- required = dictionary [ "required" ] ,
126
+ required = dictionary . get ( "required" , False ) ,
127
127
options = [Option .from_dict (o ) for o in dictionary ["options" ]],
128
- schema_id = dictionary .get ("schemaNodeId" , [] ),
129
- feature_schema_id = dictionary .get ("featureSchemaId" , [] ))
128
+ schema_id = dictionary .get ("schemaNodeId" , None ),
129
+ feature_schema_id = dictionary .get ("featureSchemaId" , None ))
130
130
131
131
def asdict (self ) -> Dict [str , Any ]:
132
132
if self .class_type in Classification ._REQUIRES_OPTIONS \
@@ -201,9 +201,9 @@ class Type(Enum):
201
201
@classmethod
202
202
def from_dict (cls , dictionary : Dict [str , Any ]):
203
203
return Tool (name = dictionary ['name' ],
204
- schema_id = dictionary .get ("schemaNodeId" , [] ),
205
- feature_schema_id = dictionary .get ("featureSchemaId" , [] ),
206
- required = dictionary [ "required" ] ,
204
+ schema_id = dictionary .get ("schemaNodeId" , None ),
205
+ feature_schema_id = dictionary .get ("featureSchemaId" , None ),
206
+ required = dictionary . get ( "required" , False ) ,
207
207
tool = Tool .Type (dictionary ["tool" ]),
208
208
classifications = [
209
209
Classification .from_dict (c )
0 commit comments