SoggyBottomBoy
❔ Json Deserialization using ReferenceHandler.Preserve with record types
Is it possible to preserve reference types when using records?
The exception which is raised:
Reference metadata is not supported when deserializing constructor parameters. See type 'RecordParent'. The unsupported member type is located on type 'RecordExample'. Path: $.Child.$ref | LineNumber: 3 | BytePositionInLine: 14.'
It seems that the metadata used for reference handling ($id, $ref) is not supported for record types, I expect because the only constructor available has parameters?
Is there a way in which to resolve this without manually adding default constructors and [JsonConstructor] attributes on all records?4 replies