aind-data-schema
aind-data-schema copied to clipboard
Enum-like classes cant be used as dictionary keys
Not sure if there is a different intended use...
To reproduce:
from aind_data_schema_models.platforms import Platform
from pydantic import BaseModel
class Foo(BaseModel):
platform: dict[Platform.ONE_OF, str]
foo = Foo(platform={Platform.BEHAVIOR: "foo"})
print(foo)
bar = foo.model_dump()