コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 8 of about 8 for Portal (0.004 sec.)
Separate OpenAPI Schemas for Input and Output or Not 13339
Separate OpenAPI Schemas for Input and Output or Not Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . When using Pydantic v2 , the generated OpenAPI is a bit more e ... ate_item ( item : Item ): return item @app . get ( "/items/" ) def read_items () -> list [ Item ]: return [ Item ( name = "Portal Gun" , description = "Device to travel through the multi-rick-verse" , ), Item ( name = "Plumbus" ), ] ? Other versions an ... ate_item ( item : Item ): return item @app . get ( "/items/" ) def read_items () -> list [ Item ]: return [ Item ( name = "Portal Gun" , description = "Device to travel through the multi-rick-verse" , ), Item ( name = "Plumbus" ), ] from typing import ... ate_item ( item : Item ): return item @app . get ( "/items/" ) def read_items () -> List [ Item ]: return [ Item ( name = "Portal Gun" , description = "Device to travel through the multi-rick-verse" , ), Item ( name = "Plumbus" ), ] Model for Input If ...
https://man.mtool.work/fastapi/0.115/how-to/separate-openapi-schemas/
Generate Clients 9669
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, ... ems/" , response_model = list [ Item ]) async def get_items (): return [ { "name" : "Plumbus" , "price" : 3 }, { "name" : "Portal Gun" , "price" : 9001 }, ] ? Other versions and variants Python 3.8+ from typing import List from fastapi import FastAPI f ... ems/" , response_model = List [ Item ]) async def get_items (): return [ { "name" : "Plumbus" , "price" : 3 }, { "name" : "Portal Gun" , "price" : 9001 }, ] Notice that the path operations define the models they use for request payload and response pay ... el = list [ Item ], tags = [ "items" ]) async def get_items (): return [ { "name" : "Plumbus" , "price" : 3 }, { "name" : "Portal Gun" , "price" : 9001 }, ] @app . post ( "/users/" , response_model = ResponseMessage , tags = [ "users" ]) async def crea ...
https://man.mtool.work/fastapi/0.115/advanced/generate-clients/
Global Dependencies 9579
Global Dependencies Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . For some types of applications you might want to add dependencies to the whole application. Sim ... [ Depends ( verify_token ), Depends ( verify_key )]) @app . get ( "/items/" ) async def read_items (): return [{ "item" : "Portal Gun" }, { "item" : "Plumbus" }] @app . get ( "/users/" ) async def read_users (): return [{ "username" : "Rick" }, { "user ... [ Depends ( verify_token ), Depends ( verify_key )]) @app . get ( "/items/" ) async def read_items (): return [{ "item" : "Portal Gun" }, { "item" : "Plumbus" }] @app . get ( "/users/" ) async def read_users (): return [{ "username" : "Rick" }, { "user ... [ Depends ( verify_token ), Depends ( verify_key )]) @app . get ( "/items/" ) async def read_items (): return [{ "item" : "Portal Gun" }, { "item" : "Plumbus" }] @app . get ( "/users/" ) async def read_users (): return [{ "username" : "Rick" }, { "user ...
https://man.mtool.work/fastapi/0.115/tutorial/dependencies/global-dependencies/
Status Codes 8476
Status Codes You can import the status module from fastapi : from fastapi import status status is provided directly by Starlette. It contains a group of named constants (variables) with integer status codes. For example: 200: status.HTTP_20 ... ( "/items/" , status_code = status . HTTP_418_IM_A_TEAPOT ) def read_items (): return [{ "name" : "Plumbus" }, { "name" : "Portal Gun" }] ::: fastapi.status ...
https://man.mtool.work/fastapi/0.115/reference/status/
Bigger Applications - Multiple Files 8079
Bigger Applications - Multiple Files Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . If you are building an application or a web API, it's rarely the case that you ... es = { 404 : { "description" : "Not found" }}, ) fake_items_db = { "plumbus" : { "name" : "Plumbus" }, "gun" : { "name" : "Portal Gun" }} @router . get ( "/" ) async def read_items (): return fake_items_db @router . get ( "/ {item_id} " ) async def rea ... es = { 404 : { "description" : "Not found" }}, ) fake_items_db = { "plumbus" : { "name" : "Plumbus" }, "gun" : { "name" : "Portal Gun" }} @router . get ( "/" ) async def read_items (): return fake_items_db @router . get ( "/ {item_id} " ) async def rea ... es = { 404 : { "description" : "Not found" }}, ) fake_items_db = { "plumbus" : { "name" : "Plumbus" }, "gun" : { "name" : "Portal Gun" }} @router . get ( "/" ) async def read_items (): return fake_items_db @router . get ( "/ {item_id} " ) async def rea ...
https://man.mtool.work/fastapi/0.115/tutorial/bigger-applications/
レスポンスモデル 7988
レスポンスモデル path operations のいずれにおいても、 response_model パラメータを使用して、レスポンスのモデルを宣言することができます: @app.get() @app.post() @app.put() @app.delete() など。 Python 3.8+ from typing import Any , List , Union ... return item @app . get ( "/items/" , response_model = List [ Item ]) async def read_items () -> Any : return [ { "name" : "Portal Gun" , "price" : 42.0 }, { "name" : "Plumbus" , "price" : 32.0 }, ] ? Other versions and variants Python 3.10+ Python 3.9+ ... return item @app . get ( "/items/" , response_model = list [ Item ]) async def read_items () -> Any : return [ { "name" : "Portal Gun" , "price" : 42.0 }, { "name" : "Plumbus" , "price" : 32.0 }, ] from typing import Any , Union from fastapi import Fas ... return item @app . get ( "/items/" , response_model = list [ Item ]) async def read_items () -> Any : return [ { "name" : "Portal Gun" , "price" : 42.0 }, { "name" : "Plumbus" , "price" : 32.0 }, ] 備考 response_model は「デコレータ」メソッド( get 、 ...
https://man.mtool.work/fastapi/0.115/tutorial/response-model/
Form Models 7898
Form Models Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can use Pydantic models to declare form fields in FastAPI. Info To use forms, first install python- ... they will receive an error response. For example, if the client tries to send the form fields: username : Rick password : Portal Gun extra : Mr. Poopybutthole They will receive an error response telling them that the field extra is not allowed: { "det ...
https://man.mtool.work/fastapi/0.115/tutorial/request-form-models/
Release Notes 7193
Release Notes Latest Changes 0.115.11 Fixes ? Add docs examples and tests (support) for Annotated custom validations, like AfterValidator , revert #13440 . PR #13442 by @tiangolo . New docs: Query Parameters and String Validations - Custom ... import Annotated app = FastAPI () data = { "plumbus" : { "description" : "Freshly pickled plumbus" , "owner" : "Morty" }, "portal-gun" : { "description" : "Gun to create portals" , "owner" : "Rick" }, } class OwnerError ( Exception ): pass def get_user ...
https://man.mtool.work/fastapi/0.115/release-notes/
PREV 1 NEXT