| 43 | |
| 44 | try: |
| 45 | class InitializeRequestPatch(InitializeRequest): |
| 46 | @field_validator("protocolVersion", mode="before") |
| 47 | @classmethod |
| 48 | def normalize_protocol_version(cls, value: Any) -> int: |
| 49 | if isinstance(value, str): |
| 50 | try: |
| 51 | return int(value.split(".")[0]) |
| 52 | except Exception: |
| 53 | return 1 |
| 54 | if isinstance(value, (int, float)): |
| 55 | return int(value) |
| 56 | return 1 |
| 57 | |
| 58 | InitializeRequest = InitializeRequestPatch |
| 59 | InitializeRequest.model_rebuild(force=True) |
nothing calls this directly
no outgoing calls
no test coverage detected