Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 2 of 2 for AfterValidator (0.05 seconds)

  1. docs_src/query_params_str_validations/tutorial015_an_py310.py

    import random
    from typing import Annotated
    
    from fastapi import FastAPI
    from pydantic import AfterValidator
    
    app = FastAPI()
    
    data = {
        "isbn-9781529046137": "The Hitchhiker's Guide to the Galaxy",
        "imdb-tt0371724": "The Hitchhiker's Guide to the Galaxy",
        "isbn-9781439512982": "Isaac Asimov: The Complete Stories, Vol. 2",
    }
    
    
    def check_valid_id(id: str):
        if not id.startswith(("isbn-", "imdb-")):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Mar 01 22:02:35 GMT 2025
    - 768 bytes
    - Click Count (0)
  2. fastapi/sse.py

    from typing import Annotated, Any
    
    from annotated_doc import Doc
    from pydantic import AfterValidator, BaseModel, Field, model_validator
    from starlette.responses import StreamingResponse
    
    # Canonical SSE event schema matching the OpenAPI 3.2 spec
    # (Section 4.14.4 "Special Considerations for Server-Sent Events")
    _SSE_EVENT_SCHEMA: dict[str, Any] = {
        "type": "object",
        "properties": {
            "data": {"type": "string"},
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 09:21:52 GMT 2026
    - 6.2K bytes
    - Click Count (0)
Back to Top