コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 10 of about 50 for OpenAPI (0.002 sec.)
Extending OpenAPI 13355
Extending OpenAPI Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . There are some cases where you might need to modify the generated OpenAPI schema. In this section ... you will see how. The normal process The normal (default) process, is as follows. A FastAPI application (instance) has an .openapi() method that is expected to return the OpenAPI schema. As part of the application object creation, a path operation for / ... openapi.json (or for whatever you set your openapi_url ) is registered. It just returns a JSON response with the result of the application's .openapi() method. By default, w ... hat the method .openapi() does is check the property .openapi_schema to see if it has contents and return them. If it doesn't, it generates them u ...
https://man.mtool.work/fastapi/0.115/how-to/extending-openapi/
Custom Docs UI Static Assets (Self-Hosting) 10978
Custom Docs UI Static Assets (Self-Hosting) Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . The API docs use Swagger UI and ReDoc , and each of those need some Jav ... disable them, set their URLs to None when creating your FastAPI app: Python 3.8+ from fastapi import FastAPI from fastapi.openapi.docs import ( get_redoc_html , get_swagger_ui_html , get_swagger_ui_oauth2_redirect_html , ) app = FastAPI ( docs_url = No ... one ) @app . get ( "/docs" , include_in_schema = False ) async def custom_swagger_ui_html (): return get_swagger_ui_html ( openapi_url = app . openapi_url , title = app . title + " - Swagger UI" , oauth2_redirect_url = app . swagger_ui_oauth2_redirect_u ... uth2_redirect_html () @app . get ( "/redoc" , include_in_schema = False ) async def redoc_html (): return get_redoc_html ( openapi_url = app . openapi_url , title = app . title + " - ReDoc" , redoc_js_url = "https://unpkg.com/redoc@next/bundles/redoc.st ...
https://man.mtool.work/fastapi/0.115/how-to/custom-docs-ui-assets/
Generate Clients 10798
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, ... obvious is that you can generate clients (sometimes called SDKs ) for your API, for many different programming languages . OpenAPI Client Generators There are many tools to generate clients from OpenAPI . A common tool is OpenAPI Generator . If you are ... building a frontend , a very interesting alternative is openapi-ts . Client and SDK Generators - Sponsor There are also some company-backed Client and SDK generators based on OpenAPI (Fa ... ou can see those schemas because they were declared with the models in the app. That information is available in the app's OpenAPI schema , and then shown in the API docs (by Swagger UI). And that same information from the models that is included in Ope ...
https://man.mtool.work/fastapi/0.115/advanced/generate-clients/
条件付き OpenAPI 10151
条件付き OpenAPI 必要であれば、設定と環境変数を利用して、環境に応じて条件付きでOpenAPIを構成することが可能です。また、完全にOpenAPIを無効にすることもできます。 セキュリティとAPI、およびドキュメントについて 本番環境においてドキュメントのUIを ... APIドキュメントをどうしても無効にしたいという、非常に特殊なユースケースがあるかもしれません。 設定と環境変数による条件付き OpenAPI 生成するOpenAPIとドキュメントUIの構成は、共通のPydanticの設定を使用して簡単に切り替えられます。 例えば、 Python 3.8+ from ... fastapi import FastAPI from pydantic_settings import BaseSettings class Settings ( BaseSettings ): openapi_url : str = "/openapi.json" settings = Settings () app = FastAPI ( openapi_url = settings . openapi_url ) @app . get ( "/" ... ) def root (): return { "message" : "Hello World" } ここでは openapi_url の設定を、デフォルトの "/openapi.json" のまま宣言しています。 そして、これを FastAPI appを作る際に使います。 それから、 ...
https://man.mtool.work/fastapi/0.115/how-to/conditional-openapi/
General - How To - Recipes 9941
General - How To - Recipes Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Here are several pointers to other places in the docs, for general or frequent questions ... u don't return more data than you should, read the docs for Tutorial - Response Model - Return Type . Documentation Tags - OpenAPI To add tags to your path operations , and group them in the docs UI, read the docs for Tutorial - Path Operation Configura ... tions - Tags . Documentation Summary and Description - OpenAPI To add a summary and description to your path operations , and show them in the docs UI, read the docs for Tutorial - Path ... Operation Configurations - Summary and Description . Documentation Response description - OpenAPI To define the description of the response, shown in the docs UI, read the docs for Tutorial - Path Operation Configuration ...
https://man.mtool.work/fastapi/0.115/how-to/general/
OpenAPI docs 9805
OpenAPI docs Utilities to handle OpenAPI automatic UI documentation, including Swagger UI (by default at /docs ) and ReDoc (by default at /redoc ). ::: fastapi.openapi.docs.get_swagger_ui_html ::: fastapi.openapi.docs.get_redoc_html ::: fas ... tapi.openapi.docs.get_swagger_ui_oauth2_redirect_html ::: fastapi.openapi.docs.swagger_ui_default_parameters ...
https://man.mtool.work/fastapi/0.115/reference/openapi/docs/
メタデータとドキュメントのURL 9294
メタデータとドキュメントのURL FastAPI アプリケーションのいくつかのメタデータの設定をカスタマイズできます。 タイトル、説明文、バージョン 以下を設定できます: タイトル : OpenAPIおよび自動APIドキュメントUIでAPIのタイトル/名前として使用される。 ... 説明文 : OpenAPIおよび自動APIドキュメントUIでのAPIの説明文。 バージョン : APIのバージョン。例: v2 または 2.5.0 。 *たとえば、以前のバージョン ... のアプリケーションがあり、OpenAPIも使用している場合に便利です。 これらを設定するには、パラメータ title 、 description 、 version を使用します: Python 3.8+ fr ... n [{ "name" : "Katana" }] この設定では、自動APIドキュメントは以下の様になります: タグのためのメタデータ さらに、パラメータ openapi_tags を使うと、path operations をグループ分けするための複数のタグに関するメタデータを追加できます。 それぞれのタグ毎にひと ...
https://man.mtool.work/fastapi/0.115/tutorial/metadata/
OpenAPI models 9114
OpenAPI models OpenAPI Pydantic models used to generate and validate the generated OpenAPI. ::: fastapi.openapi.models ...
https://man.mtool.work/fastapi/0.115/reference/openapi/models/
Additional Responses in OpenAPI 8602
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 ... esponses, with additional status codes, media types, descriptions, etc. Those additional responses will be included in the OpenAPI schema, so they will also appear in the API docs. But for those additional responses you have to make sure you return a Re ... , just like response_model . FastAPI will take that model, generate its JSON Schema and include it in the correct place in OpenAPI. For example, to declare another response with a status code 404 and a Pydantic model Message , you can write: Python 3.8+ ... "Item not found" }) Note Keep in mind that you have to return the JSONResponse directly. Info The model key is not part of OpenAPI. FastAPI will take the Pydantic model from there, generate the JSON Schema, and put it in the correct place. The correct p ...
https://man.mtool.work/fastapi/0.115/advanced/additional-responses/
Behind a Proxy 8437
Behind a Proxy Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In some situations, you might need to use a proxy server like Traefik or Nginx with a configuration ... erything would work as normally. But then, when you open the integrated docs UI (the frontend), it would expect to get the OpenAPI schema at /openapi.json , instead of /api/v1/openapi.json . So, the frontend (that runs in the browser) would try to reach ... /openapi.json and wouldn't be able to get the OpenAPI schema. Because we have a proxy with a path prefix of /api/v1 for our app, th ... e frontend needs to fetch the OpenAPI schema at /api/v1/openapi.json . graph LR browser("Browser") proxy["Proxy on http://0.0.0.0:9999/api/v1/app"] server["Serv ...
https://man.mtool.work/fastapi/0.115/advanced/behind-a-proxy/
PREV 1 2 3 4 5 NEXT