Skip to content

Commit 8afcf01

Browse files
committed
Fix python 3.8 issue
1 parent 4fb808b commit 8afcf01

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

workos/types/fga/warnings.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from typing import Sequence, Annotated, Union, Any, Dict
1+
from typing import Sequence, Union, Any, Dict, Literal
2+
from typing_extensions import Annotated
23

34
from pydantic import BeforeValidator
45
from pydantic_core.core_schema import ValidationInfo
@@ -12,6 +13,7 @@ class FGABaseWarning(WorkOSModel):
1213

1314

1415
class MissingContextKeysWarning(FGABaseWarning):
16+
code: Literal["missing_context_keys"]
1517
keys: Sequence[str]
1618

1719

@@ -20,6 +22,8 @@ def fga_warning_dispatch_validator(
2022
) -> FGABaseWarning:
2123
if value.get("code") == "missing_context_keys":
2224
return MissingContextKeysWarning.model_validate(value)
25+
26+
# Fallback to the base warning model
2327
return FGABaseWarning.model_validate(value)
2428

2529

0 commit comments

Comments
 (0)