Locate the JSON string body from a string
(content: str)
| 46 | |
| 47 | |
| 48 | def locate_json_string_body_from_string(content: str) -> Union[str, None]: |
| 49 | """Locate the JSON string body from a string""" |
| 50 | maybe_json_str = re.search(r"{.*}", content, re.DOTALL) |
| 51 | if maybe_json_str is not None: |
| 52 | return maybe_json_str.group(0) |
| 53 | else: |
| 54 | return None |
| 55 | |
| 56 | |
| 57 | def convert_response_to_json(response: str) -> dict: |
no outgoing calls
no test coverage detected