Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 2 of 2 for UnionType (0.07 seconds)

  1. fastapi/_compat/v2.py

        Union,
        cast,
        get_args,
        get_origin,
    )
    
    from fastapi._compat import lenient_issubclass, shared
    from fastapi.openapi.constants import REF_TEMPLATE
    from fastapi.types import IncEx, ModelNameMap, UnionType
    from pydantic import BaseModel, ConfigDict, Field, TypeAdapter, create_model
    from pydantic import PydanticSchemaGenerationError as PydanticSchemaGenerationError
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 16.7K bytes
    - Click Count (0)
  2. fastapi/dependencies/utils.py

        """Check if field type is a Union where all members are BaseModel subclasses."""
        from fastapi.types import UnionType
    
        origin = get_origin(field_type)
    
        # Check if it's a Union type (covers both typing.Union and types.UnionType in Python 3.10+)
        if origin is not Union and origin is not UnionType:
            return False
    
        union_args = get_args(field_type)
    
        for arg in union_args:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 38.7K bytes
    - Click Count (3)
Back to Top