Skip to content

Commit

Permalink
Authorize to have a union for request parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Gauvrit committed Jan 9, 2024
1 parent 2ece9f8 commit c56c3b7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/blacksmith/domain/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from collections import defaultdict
from dataclasses import dataclass
from typing import Mapping, MutableMapping, Optional, Tuple, Type
from typing import Any, Mapping, MutableMapping, Optional, Tuple, Type, TypeVar

from blacksmith.typing import (
ClientName,
Expand All @@ -18,8 +18,11 @@
from .exceptions import ConfigurationError, UnregisteredClientException
from .model import AbstractCollectionParser, Request, Response

Schemas = Tuple[Type[Request], Optional[Type[Response]]]
Contract = Mapping[HTTPMethod, Schemas]

TRequest = TypeVar("TRequest", bound=Request)

Schemas = Tuple[TRequest, Optional[Type[Response]]]
Contract = Mapping[HTTPMethod, Schemas[Any]]


@dataclass(frozen=True)
Expand Down

0 comments on commit c56c3b7

Please sign in to comment.