def METHOD_NAME():
    class NestedData(BaseModel):
        id: str
    class NestedModel(BaseModel):
        root: List[NestedData]
        @model_validator(mode='before')
        @classmethod
        def populate_root(cls, values):
            return {'root': values}
        @model_serializer(mode='wrap')
        def _serialize(self, handler, info):
            data = handler(self)
            if info.mode == 'json':
                return data['root']
            else:
                return data
        @classmethod
        def model_modify_json_schema(cls, json_schema):
            return json_schema['properties']['root']
    class MyModel(BaseModel):
        nested: NestedModel
    m = MyModel.model_validate({'nested': [{'id': 'foo'}]})
    assert isinstance(m.nested, NestedModel)
    assert isinstance(m.nested.root[0], NestedData)