Skip to content

Commit

Permalink
fix: typing for @serializable.view was incorrect
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Horton <paul.horton@owasp.org>
  • Loading branch information
madpah committed Jan 23, 2023
1 parent 84e7826 commit 756032b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion serializable/__init__.py
Expand Up @@ -51,6 +51,7 @@ class _Klass(Protocol):
__name__: str
__qualname__: str

ViewType = _Klass

@enum.unique
class SerializationType(str, enum.Enum):
Expand Down Expand Up @@ -1103,7 +1104,7 @@ def inner(*args: Any, **kwargs: Any) -> Any:
return outer


def view(view_: Type[_T]) -> Callable[[_F], _F]:
def view(view_: ViewType) -> Callable[[_F], _F]:
def outer(f: _F) -> _F:
logger.debug(f'Registering {f.__module__}.{f.__qualname__} with View: {view_}')
ObjectMetadataLibrary.register_property_view(
Expand Down

0 comments on commit 756032b

Please sign in to comment.