Hi again!
I currently have some code like...
@serde(tagging=InternalTagging("type"))
@dataclass(frozen=True, kw_only=True)
class ConfigFile:
items: list[ConfigA | ConfigB]
As far as I can tell, in the config file, items[].type must be either "ConfigA" or "ConfigB" but I'd like to use "A" or "B" in the config file instead. Perhaps we can add a mapping in the Tagging types so we can expect custom values?
Something like...
@serde(tagging=InternalTagging("type", tag_types={"A": ConfigA, "B": ConfigB}))
@dataclass(frozen=True, kw_only=True)
class ConfigFile:
items: list[ConfigA | ConfigB]
What do you think?
Hi again!
I currently have some code like...
As far as I can tell, in the config file,
items[].typemust be either "ConfigA" or "ConfigB" but I'd like to use "A" or "B" in the config file instead. Perhaps we can add a mapping in the Tagging types so we can expect custom values?Something like...
What do you think?