from pydantic import BaseModel  # noqa: E0611


def get_model_defaults(model_class: BaseModel):
    """Return the default values for fields in a Pydantic BaseModel.
    If a field doesn't have a default then return None.
    Default values may also be None.

    Returns
    -------
    dict

    """
    return {x: y.get("default") for x, y in model_class.schema()["properties"].items()}