Skip to content

Commit

Permalink
fix: 🐛 utilize generic model object
Browse files Browse the repository at this point in the history
  • Loading branch information
iwpnd committed Nov 21, 2021
1 parent 04cad31 commit 1f95d2c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pyle38/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import BaseModel as PydanticBaseModel
from pydantic.generics import GenericModel as PydanticGenericModel

T = TypeVar("T", bound=Dict)
T = TypeVar("T", bound=Union[Dict, str])
S = TypeVar("S", bound=str)


Expand Down Expand Up @@ -56,11 +56,7 @@ class ObjectsResponse(JSONResponse, GenericModel, Generic[T]):
fields: Optional[List[str]] = None


class StringObject(BaseModel):
object: str
id: Union[str, int]
distance: Optional[float] = None
fields: Optional[List[int]] = None
StringObject = Object[str]


class StringObjectResponse(JSONResponse, GenericModel):
Expand Down

0 comments on commit 1f95d2c

Please sign in to comment.