Changes between Version 25 and Version 26 of pyson
- Timestamp:
- 05/14/21 14:21:15 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
pyson
v25 v26 124 124 However json requires strings as keys. 125 125 126 And an example using @JsonGetter 127 {{{ 128 from pyson.ObjectMapper import ObjectMapper 129 from pyson.JsonGetter import JsonGetter 130 class Getter: 131 def __init__(self, a:int): 132 self._a=a 133 @JsonGetter("a") 134 def getValue(self): 135 return self._a 136 137 getter=Getter(17) 138 pyson=ObjectMapper() 139 pyson.toJson(getter) 140 }}} 141 142 143 144 126 145 == Add/Extend annotations at runtime 127 146 You can also add/extend existing annotations at runtime.