Adds a ${subobject} parameter for serializeCodeFormatter. For objects, this parameter is equivalent to ${object_varname}.${field_varname} in a field context, or ${iterator} in a collection context.
This is much needed by the interface PR; without a feature like this, it's impossible to write one serializeCodeFormatter that can be used in both collections and field references.
If a better name is possible for this parameter, it can easily be extended to scalars, since the idea is the same. But with the name ${subobject}, those did not seem to be appropriate semantics.
This PR also includes a fix in import generation in JsonParserClassData.getJsonCode that was breaking list references in the test code.
Looks good! Per offline discussion, we may want to differentiate the serializeCodeFormatter's behavior in JsonType and JsonField to avoid some potential confusion. It can be tracked separately.
Adds a
${subobject}
parameter forserializeCodeFormatter
. For objects, this parameter is equivalent to${object_varname}.${field_varname}
in a field context, or${iterator}
in a collection context.This is much needed by the interface PR; without a feature like this, it's impossible to write one
serializeCodeFormatter
that can be used in both collections and field references.If a better name is possible for this parameter, it can easily be extended to scalars, since the idea is the same. But with the name
${subobject}
, those did not seem to be appropriate semantics.This PR also includes a fix in import generation in
JsonParserClassData.getJsonCode
that was breaking list references in the test code.