MCPcopy Index your code
hub / github.com/fastapi/fastapi / create_body_model

Function create_body_model

fastapi/_compat/v2.py:387–392  ·  view source on GitHub ↗
(
    *, fields: Sequence[ModelField], model_name: str
)

Source from the content-addressed store, hash-verified

385
386
387def create_body_model(
388 *, fields: Sequence[ModelField], model_name: str
389) -> type[BaseModel]:
390 field_params = {f.name: (f.field_info.annotation, f.field_info) for f in fields}
391 BodyModel: type[BaseModel] = create_model(model_name, **field_params) # type: ignore[call-overload] # ty: ignore[no-matching-overload]
392 return BodyModel
393
394
395def get_model_fields(model: type[BaseModel]) -> list[ModelField]:

Callers 1

get_body_fieldFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…