Changes between Version 36 and Version 37 of pyson


Ignore:
Timestamp:
05/26/21 10:20:48 (4 years ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pyson

    v36 v37  
    4343=== Serialization
    4444Serialization of an object is much more straightforward.
    45 * Create a json dict, with keys the arguments of the __init__ function of the object and the value the serialized value returned by the getter (also considering @JsonGetter)
     45* Create a json dict, with keys the arguments of the {{{__init__}}} function of the object and the value the serialized value returned by the getter (also considering @JsonGetter)
    4646* If the object is an instance of a class with @JsonSubtypes, add/wrap the json with class info according to the @JsonTypeInfo
     47
     48=== Primitive types
     49Primitive types are types that are built into Python and do not have the {{{__init__}}} function as we expect, for instance float, str. Therefore these need to be intercepted and handled through special constructors and serializers.
     50
     51The following primitives are recognised and handled separately:
     52
     53int, float, bool, str, complex, range, bytes, bytearray, datetime, URI, Decimal, dict, list
     54
     55The dict and list are treated even more special as we also support the List[TYPE] and Dict[KEYTYPE, VALUETYPE] types.
     56
    4757
    4858== Annotations