Using types
Nested request parameters are TypedDicts. Responses are Pydantic models which also provide helper methods for things like:- Serializing back into JSON,
model.to_json() - Converting to a dictionary,
model.to_dict()
python.analysis.typeCheckingMode to basic.
Nested params
Nested parameters are dictionaries, typed usingTypedDict, for example:
File uploads
Request parameters that correspond to file uploads can be passed asbytes, or a PathLike instance or a tuple of (filename, contents, media type).
PathLike instance, the file contents will be read asynchronously automatically.