Open shizhx opened 5 months ago
To be honest I never quite understood the use case for either PrimitiveDecode() or json.RawMessage. I'll have a closer look at the issue you linked and look up some more about json.RawMessage as well, and see what to do about it.
Either way, it's not going away until a potential v2, which may never materialize. So no hurries.
@shizhx is there any update on the issue? Right now there is no way to parse any
field based on type that is quite a common use-case
This commit 4f8abaa marks both PrimitiveDecode and MetaData.PrimitiveDecode() as deprecated, but without these mechanisms, we would not be able to implement delayed parsing based on another field, which is the scenario described in #125. The
Unmarshaler
interface can't achieve the same effect because there's no type context.To be honest, I think
toml.Primitive
is not as convenient asjson.RawMessage
because it requires holding theMetaData
object for a long time.