Currently, resource configs are just stored as a dict. This makes it kind of annoying to work with them (e.g., raw dictionary lookups everywhere like config["fields"][field_name]["type"], no IDE help for knowing which keys should exist). But also, if you forget a key in the resource config, you get pretty unhelpful error messages (some random function deep inside karp fails with a KeyError or similar).
Maybe we could make a Pydantic class for the resource config. That way we can validate the config, get better type information and also have helper methods for doing common tasks with the resource config.
Currently, resource configs are just stored as a dict. This makes it kind of annoying to work with them (e.g., raw dictionary lookups everywhere like
config["fields"][field_name]["type"]
, no IDE help for knowing which keys should exist). But also, if you forget a key in the resource config, you get pretty unhelpful error messages (some random function deep inside karp fails with aKeyError
or similar).Maybe we could make a Pydantic class for the resource config. That way we can validate the config, get better type information and also have helper methods for doing common tasks with the resource config.