(annotation: Any)
| 238 | |
| 239 | |
| 240 | def _strip_optional(annotation: Any) -> Tuple[Any, bool]: |
| 241 | origin = get_origin(annotation) |
| 242 | if origin is Union: |
| 243 | args = [arg for arg in get_args(annotation) if arg is not type(None)] # noqa: E721 |
| 244 | if len(args) == 1 and len(args) != len(get_args(annotation)): |
| 245 | return args[0], True |
| 246 | return annotation, False |
| 247 | |
| 248 | |
| 249 | def _annotation_to_schema(annotation: Any) -> Dict[str, Any]: |
no outgoing calls
no test coverage detected