Skip to content

Commit 5e310dc

Browse files
committed
ref(types): make ASGI Scope fields NotRequired as per official ASGI Spec
1 parent 236d66b commit 5e310dc

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

sentry_sdk/_types.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,16 +285,17 @@ class SDKInfo(TypedDict):
285285
"type": str,
286286
"asgi": _ASGIInfo,
287287
"http_version": str,
288-
"server": tuple[str, int],
289-
"client": tuple[str, int],
290-
"scheme": str,
291288
"method": str,
292-
"root_path": str,
293289
"path": str,
294-
"raw_path": bytes,
295290
"query_string": bytes,
296291
"headers": list[tuple[bytes, bytes]],
297-
"state": dict[str, Any],
292+
# Optional fields per ASGI spec
293+
"scheme": NotRequired[str],
294+
"raw_path": NotRequired[bytes],
295+
"root_path": NotRequired[str],
296+
"client": NotRequired[tuple[str, int]],
297+
"server": NotRequired[tuple[str, int]],
298+
"state": NotRequired[dict[str, Any]],
298299
},
299300
)
300301
_TransactionContext = TypedDict(

0 commit comments

Comments
 (0)