コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 5 of about 5 for length (0.002 sec.)
クエリパラメータと文字列の検証 12630
クエリパラメータと文字列の検証 FastAPI ではパラメータの追加情報とバリデーションを宣言することができます。 以下のアプリケーションを例にしてみましょう: Python 3.8+ from typing import Union from fastapi import FastAPI app = FastAPI () @app . g ... y app = FastAPI () @app . get ( "/items/" ) async def read_items ( q : Union [ str , None ] = Query ( default = None , max_length = 50 )): results = { "items" : [{ "item_id" : "Foo" }, { "item_id" : "Bar" }]} if q : results . update ({ "q" : q }) retur ... FastAPI , Query app = FastAPI () @app . get ( "/items/" ) async def read_items ( q : Annotated [ str | None , Query ( max_length = 50 )] = None ): results = { "items" : [{ "item_id" : "Foo" }, { "item_id" : "Bar" }]} if q : results . update ({ "q" : q ... notated app = FastAPI () @app . get ( "/items/" ) async def read_items ( q : Annotated [ Union [ str , None ], Query ( max_length = 50 )] = None ): results = { "items" : [{ "item_id" : "Foo" }, { "item_id" : "Bar" }]} if q : results . update ({ "q" : q ...
https://man.mtool.work/fastapi/0.115/tutorial/query-params-str-validations/
ボディ - フィールド 9560
ボディ - フィールド Query や Path 、 Body を使って path operation関数 のパラメータに追加のバリデーションやメタデータを宣言するのと同じように、Pydanticの Field を使ってPydanticモデルの内部でバリデーションやメタデータを宣言することができます。 ... el ): name : str description : Union [ str , None ] = Field ( default = None , title = "The description of the item" , max_length = 300 ) price : float = Field ( gt = 0 , description = "The price must be greater than zero" ) tax : Union [ float , None ... ( BaseModel ): name : str description : str | None = Field ( default = None , title = "The description of the item" , max_length = 300 ) price : float = Field ( gt = 0 , description = "The price must be greater than zero" ) tax : float | None = None @ ... el ): name : str description : Union [ str , None ] = Field ( default = None , title = "The description of the item" , max_length = 300 ) price : float = Field ( gt = 0 , description = "The price must be greater than zero" ) tax : Union [ float , None ...
https://man.mtool.work/fastapi/0.115/tutorial/body-fields/
カスタムレスポンス - HTML、ストリーム、ファイル、その他のレスポンス 7960
カスタムレスポンス - HTML、ストリーム、ファイル、その他のレスポンス デフォルトでは、 FastAPI は JSONResponse を使ってレスポンスを返します。 レスポンスを直接返す で見たように、 Response を直接返すことでこの挙動をオーバーライドできます。 しか ... 文字列の dict 。 media_type - メディアタイプを示す str 。例えば "text/html" 。 FastAPI (実際にはStarlette) は自動的にContent-Lengthヘッダーを含みます。また、media_typeに基づいたContent-Typeヘッダーを含み、テキストタイプのためにcharsetを追加します。 Python ... れます。 filename - セットされた場合、レスポンスの Content-Disposition に含まれます。 ファイルレスポンスには、適切な Content-Length 、 Last-Modified 、 ETag ヘッダーが含まれます。 Python 3.8+ from fastapi import FastAPI from fastapi.responses import File ...
https://man.mtool.work/fastapi/0.115/advanced/custom-response/
Generate Clients 7960
Generate Clients Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . As FastAPI is based on the OpenAPI specification, you get automatic compatibility with many tools, ... method of Object . keys ( pathData )) { const operation = pathData [ method ] if ( operation . tags && operation . tags . length > 0 ) { const tag = operation . tags [ 0 ] const operationId = operation . operationId const toRemove = ` ${ tag } -` if ( ... operationId . startsWith ( toRemove )) { const newOperationId = operationId . substring ( toRemove . length ) operation . operationId = newOperationId } } } } await fs . promises . writeFile ( filePath , JSON . stringify ( openapi ...
https://man.mtool.work/fastapi/0.115/advanced/generate-clients/
FastAPI 7795
FastAPI FastAPI framework, high performance, easy to learn, fast to code, ready for production ドキュメント : https://fastapi.tiangolo.com ソースコード : https://github.com/fastapi/fastapi FastAPI は、Pythonの標準である型ヒントに基づいてPyt ... 情報が含まれています: ヘッダー 、 クッキー 、 フォームフィールド 、 ファイル などの他の場所からの パラメータ 宣言。 maximum_length や regex のような 検証や制約 を設定する方法。 非常に強力で使いやすい 依存性注入 システム。 JWT トークン を用いた OAuth2 や ...
https://man.mtool.work/fastapi/0.115/
PREV 1 NEXT