Changes between Version 61 and Version 62 of pyson


Ignore:
Timestamp:
10/27/22 10:44:41 (2 years ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pyson

    v61 v62  
    9090
    9191=== {{{@JsonValue}}}
    92 indicates that the value of annotated accessor
    93 (either field or "getter" method [a method with non-void return type,
    94 no args]) is to be used as the single value to serialize for the
     92indicates that the value of annotated getter method
     93is to be used as the single value to serialize for the
    9594instance, instead of the usual method of collecting properties
    9695of value.
     96Note that in python you can only create what you would call "java class fields"
     97in the constructor, like this
     98{{{
     99class X:
     100  def __init__(self,..):
     101    self._x = initialvalue
     102}}}
     103
     104Therefore the jackson alternative of annotating a field with @JsonValue makes no sense in python.
     105
    97106
    98107