@@ -43,7 +43,7 @@ class Link:
43
43
media_type : Optional description of the media type. Registered Media Types
44
44
are preferred. See :class:`~pystac.MediaType` for common media types.
45
45
title : Optional title for this link.
46
- properties : Optional, additional properties for this link. This is used
46
+ extra_fields : Optional, additional fields for this link. This is used
47
47
by extensions as a way to serialize and deserialize properties on link
48
48
object JSON.
49
49
"""
@@ -64,8 +64,8 @@ class Link:
64
64
title : Optional [str ]
65
65
"""Optional title for this link."""
66
66
67
- properties : Optional [ Dict [str , Any ] ]
68
- """Optional, additional properties for this link. This is used by extensions as a
67
+ extra_fields : Dict [str , Any ]
68
+ """Optional, additional fields for this link. This is used by extensions as a
69
69
way to serialize and deserialize properties on link object JSON."""
70
70
71
71
owner : Optional ["STACObject_Type" ]
@@ -79,13 +79,13 @@ def __init__(
79
79
target : Union [str , "STACObject_Type" ],
80
80
media_type : Optional [str ] = None ,
81
81
title : Optional [str ] = None ,
82
- properties : Optional [Dict [str , Any ]] = None ,
82
+ extra_fields : Optional [Dict [str , Any ]] = None ,
83
83
) -> None :
84
84
self .rel = rel
85
85
self .target = target
86
86
self .media_type = media_type
87
87
self .title = title
88
- self .properties = properties
88
+ self .extra_fields = extra_fields or {}
89
89
self .owner = None
90
90
91
91
def set_owner (self , owner : Optional ["STACObject_Type" ]) -> "Link" :
@@ -260,9 +260,8 @@ def to_dict(self) -> Dict[str, Any]:
260
260
if self .title is not None :
261
261
d ["title" ] = self .title
262
262
263
- if self .properties :
264
- for k , v in self .properties .items ():
265
- d [k ] = v
263
+ for k , v in self .extra_fields .items ():
264
+ d [k ] = v
266
265
267
266
return d
268
267
@@ -299,16 +298,16 @@ def from_dict(d: Dict[str, Any]) -> "Link":
299
298
media_type = d .pop ("type" , None )
300
299
title = d .pop ("title" , None )
301
300
302
- properties = None
301
+ extra_fields = None
303
302
if any (d ):
304
- properties = d
303
+ extra_fields = d
305
304
306
305
return Link (
307
306
rel = rel ,
308
307
target = href ,
309
308
media_type = media_type ,
310
309
title = title ,
311
- properties = properties ,
310
+ extra_fields = extra_fields ,
312
311
)
313
312
314
313
@staticmethod
0 commit comments