Serde icon indicating copy to clipboard operation
Serde copied to clipboard

Pass the Deformatter to Importer::canImport()

Open Crell opened this issue 5 months ago • 0 comments

Currently, Importer::canImport() accepts a Field and a format name string. However, there are cases where we want to know more about the Deformatter, such as if its source value is an array that we can type introspect.

For 2.x, we should change the API to pass the full Deformatter to canImport().

That will also allow us to add an ArrayBased marker interface to the Array, CSV, JSON, YAML, and TOML Deformatters for canImport() to check if needed.

See the notes in MixedField and UnionField for an example of where we want that.

Crell avatar Jul 11 '25 16:07 Crell