# generated by datamodel-codegen:
#   filename:  referenced_default.yaml
#   timestamp: 2019-07-26T00:00:00+00:00

from __future__ import annotations

from typing import Annotated, Optional

from pydantic import BaseModel, Field, RootModel


class ModelSettingB(RootModel[float]):
    root: Annotated[float, Field(ge=0.0, le=10.0)]


class Model(BaseModel):
    settingA: Annotated[Optional[float], Field(ge=0.0, le=10.0)] = 5
    settingB: Annotated[
        Optional[ModelSettingB],
        Field(default_factory=lambda: ModelSettingB.model_validate(ModelSettingB(5))),
    ]
