Changes between Version 77 and Version 78 of pyson


Ignore:
Timestamp:
06/05/24 13:58:11 (11 months ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pyson

    v77 v78  
    105105Indicates that that other class is a sub-class of the annotated class. The other class can be used for deserialization as well.
    106106
    107 If this is used, the @JsonTypeInfo must also be provided.
     107If this is used, the @JsonTypeInfo must also be provided. If you do not specify @JsonTypeInfo, then the default is used which means the type info is not attached to the serialized format, causing deserialization to fail.
     108
     109Example: {{{@JsonSubTypes(['A','B'])}}} attached to class C
     110indicates that class A and B are subclasses of C.
     111
     112
    108113
    109114=== {{{@JsonValue}}}
     
    146151
    147152At this moment WRAPPER_OBJECT should be used; the others are not properly implemented.
     153
     154
     155example:
     156{{{@JsonTypeInfo(use=Id.NAME, include=As.WRAPPER_OBJECT)}}} added to class C indicates that all fields in C will be wrapped inside a wrapper object (a json dict), and that the key of the dict will be the (short) NAME of the class. The de-serializer will use that directly to use the indicated class for deserialization of the json
    148157
    149158=== {{{@JsonDeserialize}}}