diff --git a/pyproject.toml b/pyproject.toml index 5b45bf5..ea74eff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,3 +22,6 @@ packages = [ ] package-dir = { '' = 'src' } + +[tool.setuptools.package-data] +'normalize_json' = ['py.typed'] diff --git a/src/micromodel/micromodel.py b/src/micromodel/micromodel.py index 821efd6..9fef17f 100644 --- a/src/micromodel/micromodel.py +++ b/src/micromodel/micromodel.py @@ -21,7 +21,8 @@ def __init__(self, model_type: typing.Callable[[typing.Any], T], ct: dict[str, t if coll: self.coll = coll - def cast(self, target: T | dict[str, typing.Any]): return typing.cast(T, target) + def cast(self, target: T | typing.Any): return typing.cast(T, target) + def strict_cast(self, target: T): return target def validate(self, target: T, options: ValidationOptions = {}): return validate(self.model_type, typing.cast(typing.Any, target), options, self.ct) def find(self, *args: typing.Any, **kwargs: typing.Any): diff --git a/src/micromodel/py.typed b/src/micromodel/py.typed new file mode 100644 index 0000000..e69de29