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

from __future__ import annotations

from typing import Annotated, Literal

from pydantic import BaseModel, Field


class A(BaseModel):
    type: Literal['a'] | None = None


class B(BaseModel):
    type: Literal['b']
    value: int | None = None


type Alias = dict[str, A | B]


class Model(BaseModel):
    x_value: Annotated[Alias | None, Field(validate_default=True)] = {
        'k': {'type': 'b', 'value': 1}
    }
