diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2021-09-03 09:22:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-03 09:22:22 -0400 |
commit | ecbfa4fe4fa7625dec14ef8f9bd06cc4ad141de0 (patch) | |
tree | 732bb7811ccffe2c68fb59fbb8351486ff786d77 /synapse/http | |
parent | Fix bug with reusing 'txn' when persisting event. (#10743) (diff) | |
download | synapse-ecbfa4fe4fa7625dec14ef8f9bd06cc4ad141de0.tar.xz |
Additional type hints for client REST servlets (part 5) (#10736)
Additionally this enforce type hints on all function signatures inside of the synapse.rest.client package.
Diffstat (limited to 'synapse/http')
-rw-r--r-- | synapse/http/servlet.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/synapse/http/servlet.py b/synapse/http/servlet.py index a12fa30bfd..91ba93372c 100644 --- a/synapse/http/servlet.py +++ b/synapse/http/servlet.py @@ -572,6 +572,25 @@ def parse_string_from_args( return strings[0] +@overload +def parse_json_value_from_request(request: Request) -> JsonDict: + ... + + +@overload +def parse_json_value_from_request( + request: Request, allow_empty_body: Literal[False] +) -> JsonDict: + ... + + +@overload +def parse_json_value_from_request( + request: Request, allow_empty_body: bool = False +) -> Optional[JsonDict]: + ... + + def parse_json_value_from_request( request: Request, allow_empty_body: bool = False ) -> Optional[JsonDict]: |