jsonschema-extractor is a library and extensible framework for extracting json schema from various object and primitives.
Out of the box support exists for:
from typing import List
import jsonschema_extractor
assert jsonschema_extractor.extract(List[int]) == {
"type": "array",
"items": {"type": "integer"}
}