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
parent
commit
bb86eba062
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      fastapi/openapi/utils.py

3
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

Loading…
Cancel
Save