Add Form() annotations and fix OpenAPI generation for multipart params

- Add Form() annotations to purpose and expires_after parameters in file upload endpoints
- Add support for optional multipart form parameters in OpenAPI generator
- Generated spec now properly mirrors OpenAI format with schema refs
This commit is contained in:
Ashwin Bharambe 2025-09-29 20:14:39 -07:00
parent 8288122146
commit f676c48a97
8 changed files with 705 additions and 362 deletions

View file

@ -93,6 +93,11 @@ def get_class_property_docstrings(
"""
result = {}
# Only try to get MRO if data_type is actually a class
# Special types like Literal, Union, etc. don't have MRO
if not inspect.isclass(data_type):
return result
for base in inspect.getmro(data_type):
docstr = docstring.parse_type(base)
for param in docstr.params.values():