Ivan
5 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
6 additions and
2 deletions
-
fastapi/openapi/utils.py
|
|
@ -177,7 +177,11 @@ def get_openapi_operation_request_body( |
|
|
|
], |
|
|
|
separate_input_output_schemas: bool = True, |
|
|
|
) -> Optional[Dict[str, Any]]: |
|
|
|
if not body_field: |
|
|
|
if ( |
|
|
|
not body_field |
|
|
|
or not isinstance(body_field.field_info, Body) |
|
|
|
or not body_field.field_info.include_in_schema |
|
|
|
): |
|
|
|
return None |
|
|
|
assert isinstance(body_field, ModelField) |
|
|
|
body_schema = get_schema_from_model_field( |
|
|
@ -187,7 +191,7 @@ def get_openapi_operation_request_body( |
|
|
|
field_mapping=field_mapping, |
|
|
|
separate_input_output_schemas=separate_input_output_schemas, |
|
|
|
) |
|
|
|
field_info = cast(Body, body_field.field_info) |
|
|
|
field_info = body_field.field_info |
|
|
|
request_media_type = field_info.media_type |
|
|
|
required = body_field.required |
|
|
|
request_body_oai: Dict[str, Any] = {} |
|
|
|