mirror of https://github.com/tiangolo/fastapi.git
Support the `schema_generator` argument
This commit is contained in:
parent
040448811a
commit
ac4eb4a965
|
|
@ -450,6 +450,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,
|
||||
schema_generator: Optional[GenerateJsonSchema] = None,
|
||||
) -> Dict[str, Any]:
|
||||
info: Dict[str, Any] = {"title": title, "version": version}
|
||||
if summary:
|
||||
|
|
@ -471,7 +472,8 @@ def get_openapi(
|
|||
operation_ids: Set[str] = set()
|
||||
all_fields = get_fields_from_routes(list(routes or []) + list(webhooks or []))
|
||||
model_name_map = get_compat_model_name_map(all_fields)
|
||||
schema_generator = GenerateJsonSchema(ref_template=REF_TEMPLATE)
|
||||
if schema_generator is None:
|
||||
schema_generator = GenerateJsonSchema(ref_template=REF_TEMPLATE)
|
||||
field_mapping, definitions = get_definitions(
|
||||
fields=all_fields,
|
||||
schema_generator=schema_generator,
|
||||
|
|
|
|||
Loading…
Reference in New Issue