Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for berate (0.24 sec)

  1. docs_src/separate_openapi_schemas/tutorial002.py

    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
    
    
    app = FastAPI(separate_input_output_schemas=False)
    
    
    @app.post("/items/")
    def create_item(item: Item):
        return item
    
    
    @app.get("/items/")
    def read_items() -> List[Item]:
        return [
            Item(
                name="Portal Gun",
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Aug 25 19:10:22 GMT 2023
    - 524 bytes
    - Viewed (0)
Back to top