We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e895160 commit f02326fCopy full SHA for f02326f
src/mcp_text_editor/models.py
@@ -34,11 +34,17 @@ class EditPatch(BaseModel):
34
)
35
36
@model_validator(mode="after")
37
- def validate_end_line(self) -> "EditPatch":
38
- """Validate that range_hash is set."""
+ def validate_range_hash(self) -> "EditPatch":
+ """Validate that range_hash is set and handle end field validation."""
39
# range_hash must be explicitly set
40
if self.range_hash is None:
41
raise ValueError("range_hash is required")
42
+
43
+ # For safety, convert None to the special range hash value
44
+ if self.end is None and self.range_hash != "":
45
+ # Special case: patch with end=None is allowed
46
+ pass
47
48
return self
49
50
0 commit comments