Results of 1 - 2 of about 2 for HttpUrl (0.001 sec.)
- ボディ - ネストされたモデル 11228
- ボディ - ネストされたモデル FastAPI を使用すると、深くネストされた任意のモデルを定義、検証、文書化、使用することができます(Pydanticのおかげです)。 リストのフィールド 属性をサブタイプとして定義することができます。例えば、Pythonの list は以
...次の章でいくつかの例をみることができます。 例えば、 Image モデルのように url フィールドがある場合、 str の代わりにPydanticの HttpUrl を指定することができます: Python 3.8+ from typing import Set , Union from fastapi import FastAPI from pydantic import Base...Model , HttpUrl app = FastAPI () class Image ( BaseModel ): url : HttpUrl name : str class Item ( BaseModel ): name : str description : Un...esults ? Other versions and variants Python 3.10+ Python 3.9+ from fastapi import FastAPI from pydantic import BaseModel , HttpUrl app = FastAPI () class Image ( BaseModel ): url : HttpUrl name : str class Item ( BaseModel ): name : str description : st... - https://man.mtool.work/fastapi/0.115/tutorial/body-nested-models/
- OpenAPI Callbacks 7485
- OpenAPI Callbacks Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You could create an API with a path operation that could trigger a request to an external API cre
...liar to you: Python 3.8+ from typing import Union from fastapi import APIRouter , FastAPI from pydantic import BaseModel , HttpUrl app = FastAPI () class Invoice ( BaseModel ): id : str title : Union [ str , None ] = None customer : str total : float cl...voices/" , callbacks = invoices_callback_router . routes ) def create_invoice ( invoice : Invoice , callback_url : Union [ HttpUrl , None ] = None ): """ Create an invoice. This will (let's imagine) let the API user (some external developer) create an i...e callbacks. Python 3.8+ from typing import Union from fastapi import APIRouter , FastAPI from pydantic import BaseModel , HttpUrl app = FastAPI () class Invoice ( BaseModel ): id : str title : Union [ str , None ] = None customer : str total : float cl... - https://man.mtool.work/fastapi/0.115/advanced/openapi-callbacks/
PREV
1
NEXT