コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 5 of about 5 for declaring (0.003 sec.)
Using the Request Directly 12814
Using the Request Directly Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Up to now, you have been declaring the parts of the request that you need with their typ ... request : Request ): client_host = request . client . host return { "client_host" : client_host , "item_id" : item_id } By declaring a path operation function parameter with the type being the Request FastAPI will know to pass the Request in that paramete ... r. Tip Note that in this case, we are declaring a path parameter beside the request parameter. So, the path parameter will be extracted, validated, converted to the speci ...
https://man.mtool.work/fastapi/0.115/advanced/using-request-directly/
OpenAPI Webhooks 8696
OpenAPI Webhooks Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . There are cases where you want to tell your API users that your app could call their app (sending ... the same type you would use when structuring your app with multiple files. Notice that with webhooks you are actually not declaring a path (like /items/ ), the text you pass there is just an identifier of the webhook (the name of the event), for example ...
https://man.mtool.work/fastapi/0.115/advanced/openapi-webhooks/
Templates 8512
Templates Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can use any template engine you want with FastAPI . A common choice is Jinja2, the same one used by F ... that, in previous versions, the request object was passed as part of the key-value pairs in the context for Jinja2. Tip By declaring response_class=HTMLResponse the docs UI will be able to know that the response will be HTML. Technical Details You could a ...
https://man.mtool.work/fastapi/0.115/advanced/templates/
Additional Responses in OpenAPI 7942
Additional Responses in OpenAPI Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Warning This is a rather advanced topic. If you are starting with FastAPI , you mig ... to add different media types for the same main response. For example, you can add an additional media type of image/png , declaring that your path operation can return a JSON object (with media type application/json ) or a PNG image: Python 3.8+ from typ ...
https://man.mtool.work/fastapi/0.115/advanced/additional-responses/
OAuth2 scopes 7942
OAuth2 scopes Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can use OAuth2 scopes directly with FastAPI , they are integrated to work seamlessly. This would ... "status" : "ok" } Now let's review those changes step by step. OAuth2 Security scheme The first change is that now we are declaring the OAuth2 security scheme with two available scopes, me and items . The scopes parameter receives a dict with each scope ... ef read_system_status ( current_user : User = Depends ( get_current_user )): return { "status" : "ok" } Because we are now declaring those scopes, they will show up in the API docs when you log-in/authorize. And you will be able to select which scopes you ... endency function get_current_active_user can also declare sub-dependencies, not only with Depends but also with Security . Declaring its own sub-dependency function ( get_current_user ), and more scope requirements. In this case, it requires the scope me ...
https://man.mtool.work/fastapi/0.115/advanced/security/oauth2-scopes/
PREV 1 NEXT