Closed jwodder closed 1 year ago
so we will be storing those line numbers (what for?) but stripping when loading from a file? or am I misreading the subject?
@yarikoptic The _lineno
fields were present when you ran the code because our custom YAML loader adds those fields next to every key in every mapping when loading from a file, and those fields remained in the structure as it was updated and then serialized back to a file. Normally, unrecognized fields like these are discarded by pydantic when processing loaded YAML into classes, but the version
fields are dict
s instead of classes, so we need to use a validator to process the dict
s when instantiating the containing classes in order to prevent the _lineno
fields in versions
from ending up in the structure.
Closes #46.