diff --git a/requirements.txt b/requirements.txt index a6c6800..479a913 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,5 @@ invoke linkml mongomock pre-commit -pydantic +pydantic~=2.0 uvicorn diff --git a/tasks.py b/tasks.py index d93f0b1..1400c5a 100644 --- a/tasks.py +++ b/tasks.py @@ -21,7 +21,7 @@ def regenerate_models(_): for schema in schemas: print(schema) schema_path = Path(schema) - gen = pd.PydanticGenerator(schema, verbose=True) + gen = pd.PydanticGenerator(schema, pydantic_version="2", verbose=True) output = gen.serialize() with open(MODEL_DIRECTORY / f"{schema_path.name.strip('.yml')}.py", "w") as f: f.writelines(output)