from typing import Dict, Any, Union, Type, TypeVar from pydantic import RootModel {{name}} = RootModel[Union[ {% for type in types %} {{type.name}}, {% endfor %} ]]