77
88
99@dataclass
10- class DescriptorField :
11- """A field in the Data Package descriptor .
10+ class PropertyField :
11+ """The field of a Data Package property .
1212
1313 Attributes:
1414 jsonpath (str): The direct JSON path to the field.
@@ -21,10 +21,10 @@ class DescriptorField:
2121
2222def _get_fields_at_jsonpath (
2323 jsonpath : str , json_object : dict [str , Any ]
24- ) -> list [DescriptorField ]:
24+ ) -> list [PropertyField ]:
2525 """Returns all fields that match the JSON path."""
2626 matches = finditer (jsonpath , json_object )
27- return _map (matches , _create_descriptor_field )
27+ return _map (matches , _create_property_field )
2828
2929
3030def _get_direct_jsonpaths (jsonpath : str , json_object : dict [str , Any ]) -> list [str ]:
@@ -33,8 +33,8 @@ def _get_direct_jsonpaths(jsonpath: str, json_object: dict[str, Any]) -> list[st
3333 return _map (fields , lambda field : field .jsonpath )
3434
3535
36- def _create_descriptor_field (match : JSONPathMatch ) -> DescriptorField :
37- return DescriptorField (
36+ def _create_property_field (match : JSONPathMatch ) -> PropertyField :
37+ return PropertyField (
3838 jsonpath = match .path .replace ("['" , "." ).replace ("']" , "" ),
3939 value = match .obj ,
4040 )
0 commit comments