mirror of
https://github.com/zulip/zulip.git
synced 2025-10-30 03:23:50 +00:00
request: Support converter or json_validator with argument_type="body".
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
970f22380a
commit
04d772b582
@@ -58,6 +58,10 @@ from zerver.lib.types import ProfileFieldData, Validator
|
||||
ResultT = TypeVar("ResultT")
|
||||
|
||||
|
||||
def check_anything(var_name: str, val: object) -> object:
|
||||
return val
|
||||
|
||||
|
||||
def check_string(var_name: str, val: object) -> str:
|
||||
if not isinstance(val, str):
|
||||
raise ValidationError(_("{var_name} is not a string").format(var_name=var_name))
|
||||
|
||||
Reference in New Issue
Block a user