Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for post_model_with_tuple (0.16 sec)

  1. tests/test_tuples.py

    app = FastAPI()
    
    
    class ItemGroup(BaseModel):
        items: List[Tuple[str, str]]
    
    
    class Coordinate(BaseModel):
        x: float
        y: float
    
    
    @app.post("/model-with-tuple/")
    def post_model_with_tuple(item_group: ItemGroup):
        return item_group
    
    
    @app.post("/tuple-of-models/")
    def post_tuple_of_models(square: Tuple[Coordinate, Coordinate]):
        return square
    
    
    @app.post("/tuple-form/")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 11.8K bytes
    - Viewed (0)
Back to top