Changes between Version 29 and Version 30 of pyson


Ignore:
Timestamp:
05/18/21 08:42:55 (4 years ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pyson

    v29 v30  
    6565
    6666The "Id" value can have the value NONE, NAME, CLASS. We recommend to use NAME,
    67 ||NONE|| Do not include class id at all. Do not use this with @JsonTypeInfo. Only included because it was availale in Jackson||
     67
     68||Id Value||meaning||
     69||NONE||Do not include class id at all. Do not use this with @JsonTypeInfo. Only included because it was availale in Jackson||
    6870||NAME||Use the name of the class to refer to the class. All classes referred must have different name (not two the same names with different classpath).||
    6971||CLASS||Use the full.class.path to refer to the class. ||
    7072
    71 We recommend NAME, because it is shorter and gives more readable json, and gives you flexibility to move around the actual classes if needed without breaking compabibility with existing json files||
    72 
    73 
    74 Indicates how to include the class name is included in/extracted from the json.
    75 
    76 ====
     73NAME should be used, the others are not properly implemented. We recommend this method anyway, because it is shorter and gives more readable json, and gives you flexibility to move around the actual classes if needed without breaking compabibility with existing json files||
     74
     75The "As" annotation indicates *how* to include the class name is included in/extracted from the json.
     76
     77||As value||meaning||
     78||PROPERTY||The json dict is extended with a {{{type}}} parameter containing the class Id||
     79||WRAPPER_OBJECT||A dict is created with the class Id as key, and as value the actual class contents||
     80||WRAPPER+ARRAY||An array is used for storing the contents of the class||
     81
     82At this moment WRAPPER_OBJECT should be used; the others are not properly implemented.
    7783
    7884=== Inheritance of annotations