Results of 1 - 5 of about 5 for route (0.003 sec.)
- Custom Request and APIRoute class 12759
- Custom Request and APIRoute class Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In some cases, you may want to override the logic used by the Request and APIRoute
...ustom request body encodings Let's see how to make use of a custom Request subclass to decompress gzip requests. And an APIRoute subclass to use that custom request class. Create a custom GzipRequest class Tip This is a toy example to demonstrate how...nce of an appropriate header. If there's no gzip in the header, it will not try to decompress the body. That way, the same route class can handle gzip compressed or uncompressed requests. Python 3.8+ import gzip from typing import Callable , List from...fastapi import Body , FastAPI , Request , Response from fastapi.routing import APIRoute class GzipRequest ( Request ): async def body ( self ) -> bytes : if not hasattr ( self , "_body" ): body = await super ()... - https://man.mtool.work/fastapi/0.115/how-to/custom-request-and-route/
- Path Operationの高度な設定 9026
- Path Operationの高度な設定 OpenAPI operationId 注意 あなたがOpenAPIの「エキスパート」でなければ、これは必要ないかもしれません。 path operation で operation_id パラメータを利用することで、OpenAPIの operationId を設定できます。 operation_id は
...PIの関数名を operationId として利用したい場合、すべてのAPIの関数をイテレーションし、各 path operation の operationId を APIRoute.name で上書きすれば可能です。 そうする場合は、すべての path operation を追加した後に行う必要があります。 Python 3.8+ from...fastapi import FastAPI from fastapi.routing import APIRoute app = FastAPI () @app . get ( "/items/" ) async def read_items (): return [{ "item_id" : "Foo" }] def use_route_names_as_o...ne : """ Simplify operation IDs so that generated API clients have simpler function names. Should be called only after all routes have been added. """ for route in app . routes : if isinstance ( route , APIRoute ): route . operation_id = route . name... - https://man.mtool.work/fastapi/0.115/advanced/path-operation-advanced-configurat...
- Generate Clients 8383
- 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,
...also for the names of any needed custom models, for requests or responses. You can customize that function. It takes an APIRoute and outputs a string. For example, here it is using the first tag (you will probably have only one tag) and the path opera...stAPI as the generate_unique_id_function parameter: Python 3.9+ from fastapi import FastAPI from fastapi.routing import APIRoute from pydantic import BaseModel def custom_generate_unique_id ( route : APIRoute ): return f " { route . tags [ 0 ] } - { r...Other versions and variants Python 3.8+ from typing import List from fastapi import FastAPI from fastapi.routing import APIRoute from pydantic import BaseModel def custom_generate_unique_id ( route : APIRoute ): return f " { route . tags [ 0 ] } - { r... - https://man.mtool.work/fastapi/0.115/advanced/generate-clients/
- Including WSGI - Flask, Django, others 7960
- Including WSGI - Flask, Django, others Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can mount WSGI applications as you saw with Sub Applications - Mounts ,
...WSGIMiddleware from flask import Flask , request from markupsafe import escape flask_app = Flask ( __name__ ) @flask_app . route ( "/" ) def flask_main (): name = request . args . get ( "name" , "World" ) return f "Hello, { escape ( name ) } from Flas... - https://man.mtool.work/fastapi/0.115/advanced/wsgi/
- Release Notes 7776
- 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
...by @philipokiokio . ? Adjust spacing. PR #12635 by @alejsdev . ? Update includes in docs/en/docs/how-to/custom-request-and-route.md . PR #12560 by @philipokiokio . Translations ? Add Korean translation for docs/ko/docs/advanced/testing-websockets.md ....anced/dataclasses.md . PR #12475 by @leoscarlato . ? Add Portuguese translation for docs/pt/docs/how-to/custom-request-and-route.md . PR #12483 by @devfernandoa . Internal ⬆ Bump cloudflare/wrangler-action from 3.9 to 3.11. PR #12544 by @dependabot[bo.... It's just a checkpoint. ? Refactors ♻️ Refactor deciding if embed body fields, do not overwrite fields, compute once per router, refactor internals in preparation for Pydantic models in Form , Query and others. PR #12117 by @tiangolo . Internal ⏪️ T... - https://man.mtool.work/fastapi/0.115/release-notes/
PREV
1
NEXT