As @mwtoews has suggested we can use JSON schema for the DFN specifications (also forthcoming MF6 NetCDF spec and any other schema-related needs). A big benefit of pydantic is built-in JSON schema support . If we continue using attrs we will have to roll our own schema generation.
I think it would be a pretty clean migration from attrs to plain dataclasses. We don't have much structural validation implemented at the moment, so it should be straightforward to start using pydantic's dataclass support for that. But migrating cattrs to pydantic might be more of a chore since we have built some things around the cattrs.Converter.
This came up in recent discussions with @mjreno in the context of an MF6 NetCDF specification and related tooling.
As @mwtoews has suggested we can use JSON schema for the DFN specifications (also forthcoming MF6 NetCDF spec and any other schema-related needs). A big benefit of
pydanticis built-in JSON schema support . If we continue usingattrswe will have to roll our own schema generation.I think it would be a pretty clean migration from
attrsto plaindataclasses. We don't have much structural validation implemented at the moment, so it should be straightforward to start using pydantic's dataclass support for that. But migratingcattrsto pydantic might be more of a chore since we have built some things around thecattrs.Converter.This came up in recent discussions with @mjreno in the context of an MF6 NetCDF specification and related tooling.