Browse Source
Add external_docs parameters to get_openapi method
The OpenAPI class is being instantiated without the externalDocs parameter.
pull/13713/head
Carlos Mario Toro
2 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
3 additions and
0 deletions
-
fastapi/openapi/utils.py
|
|
@ -489,6 +489,7 @@ def get_openapi( |
|
|
|
contact: Optional[Dict[str, Union[str, Any]]] = None, |
|
|
|
license_info: Optional[Dict[str, Union[str, Any]]] = None, |
|
|
|
separate_input_output_schemas: bool = True, |
|
|
|
external_docs: Optional[Dict[str, Any]] = None, |
|
|
|
) -> Dict[str, Any]: |
|
|
|
info: Dict[str, Any] = {"title": title, "version": version} |
|
|
|
if summary: |
|
|
@ -566,4 +567,6 @@ def get_openapi( |
|
|
|
output["webhooks"] = webhook_paths |
|
|
|
if tags: |
|
|
|
output["tags"] = tags |
|
|
|
if external_docs: |
|
|
|
output["externalDocs"] = external_docs |
|
|
|
return jsonable_encoder(OpenAPI(**output), by_alias=True, exclude_none=True) # type: ignore |
|
|
|