Changes between Version 25 and Version 26 of pyson


Ignore:
Timestamp:
05/14/21 14:21:15 (4 years ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pyson

    v25 v26  
    124124However json requires strings as keys.
    125125
     126And an example using @JsonGetter
     127{{{
     128from pyson.ObjectMapper import ObjectMapper
     129from pyson.JsonGetter import JsonGetter
     130class Getter:
     131    def __init__(self, a:int):
     132        self._a=a
     133    @JsonGetter("a")
     134    def getValue(self):
     135        return self._a
     136
     137getter=Getter(17)
     138pyson=ObjectMapper()
     139pyson.toJson(getter)
     140}}}
     141
     142
     143
     144
    126145== Add/Extend annotations at runtime
    127146You can also add/extend existing annotations at runtime.