Results of 1 - 10 of about 20 for pass (0.002 sec.)
- OpenAPI Callbacks 14563
- OpenAPI Callbacks Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You could create an API with a path operation that could trigger a request to an external API cre
...}/invoices/{$request.body.id}" , response_model = InvoiceEventReceived ) def invoice_notification ( body : InvoiceEvent ): pass @app . post ( "/invoices/" , callbacks = invoices_callback_router . routes ) def create_invoice ( invoice : Invoice , call...}/invoices/{$request.body.id}" , response_model = InvoiceEventReceived ) def invoice_notification ( body : InvoiceEvent ): pass @app . post ( "/invoices/" , callbacks = invoices_callback_router . routes ) def create_invoice ( invoice : Invoice , call...}/invoices/{$request.body.id}" , response_model = InvoiceEventReceived ) def invoice_notification ( body : InvoiceEvent ): pass @app . post ( "/invoices/" , callbacks = invoices_callback_router . routes ) def create_invoice ( invoice : Invoice , call... - https://man.mtool.work/fastapi/0.115/advanced/openapi-callbacks/
- Configure Swagger UI 10094
- Configure Swagger UI Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can configure some extra Swagger UI parameters . To configure them, pass the swagger_ui_pa
...) app object or to the get_swagger_ui_html() function. swagger_ui_parameters receives a dictionary with the configurations passed to Swagger UI directly. FastAPI converts the configurations to JSON to make them compatible with JavaScript, as that's w...Valid) { oauth2.errCb({ authId: oauth2.auth.name, source: "auth", level: "warning", message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server." }); } if (qp.code) { delete oauth2.stat...of them by setting a different value in the argument swagger_ui_parameters . For example, to disable deepLinking you could pass these settings to swagger_ui_parameters : Python 3.8+ from fastapi import FastAPI app = FastAPI ( swagger_ui_parameters =... - https://man.mtool.work/fastapi/0.115/how-to/configure-swagger-ui/
- Security Tools 9805
- Security Tools When you need to declare dependencies with OAuth2 scopes you use Security() . But you still need to define what is the dependable, the callable that you pass as a parameter to Depends() or Security() . There are multiple tool
...nCredentials , HTTPBasic , HTTPBasicCredentials , HTTPBearer , HTTPDigest , OAuth2 , OAuth2AuthorizationCodeBearer , OAuth2PasswordBearer , OAuth2PasswordRequestForm , OAuth2PasswordRequestFormStrict , OpenIdConnect , SecurityScopes , ) API Key Secur...2 Authentication ::: fastapi.security.OAuth2 ::: fastapi.security.OAuth2AuthorizationCodeBearer ::: fastapi.security.OAuth2PasswordBearer OAuth2 Password Form ::: fastapi.security.OAuth2PasswordRequestForm ::: fastapi.security.OAuth2PasswordRequestFo... - https://man.mtool.work/fastapi/0.115/reference/security/
- Advanced Dependencies 8904
- Advanced Dependencies Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Parameterized dependencies All the dependencies we have seen are a fixed function or class. B
...all__ is what FastAPI will use to check for additional parameters and sub-dependencies, and this is what will be called to pass a value to the parameter in your path operation function later. Parameterize the instance And now, we can use __init__ to...the class itself. And when solving the dependency, FastAPI will call this checker like: checker ( q = "somequery" ) ...and pass whatever that returns as the value of the dependency in our path operation function as the parameter fixed_content_include... - https://man.mtool.work/fastapi/0.115/advanced/advanced-dependencies/
- Lifespan Events 8904
- Lifespan Events Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can define logic (code) that should be executed before the application starts up . This means t
...ing the with block, it will execute the code after the yield . In our code example above, we don't use it directly, but we pass it to FastAPI for it to use it. The lifespan parameter of the FastAPI app takes an async context manager , so we can pass... - https://man.mtool.work/fastapi/0.115/advanced/events/
- Response Headers 8904
- Response Headers Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Use a Response parameter You can declare a parameter of type Response in your path operation funct
...can also add headers when you return a Response directly. Create a response as described in Return a Response Directly and pass the headers as an additional parameter: Python 3.8+ from fastapi import FastAPI from fastapi.responses import JSONResponse... - https://man.mtool.work/fastapi/0.115/advanced/response-headers/
- Using the Request Directly 8904
- 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
...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 parameter. Tip Note that in this case, we are declaring a path parameter beside the request parameter.... - https://man.mtool.work/fastapi/0.115/advanced/using-request-directly/
- Development - Contributing 8904
- Development - Contributing Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . First, you might want to see the basic ways to help FastAPI and get help . Developing If
...language is English, located at docs/en/ . Now run the live server for the docs in Spanish: // Use the command "live" and pass the language code as a CLI argument $ python ./scripts/docs.py live es <span style="color: green;">[INFO]</span> Serving o..."Creole" is ht . The next step is to run the script to generate a new translation directory: // Use the command new-lang, pass the language code as a CLI argument $ python ./scripts/docs.py new-lang ht Successfully initialized: docs/ht Now you can c... - https://man.mtool.work/fastapi/0.115/contributing/
- OpenAPI Webhooks 8615
- 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
...our 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 in @app.webhooks.post("new-subscription")... - https://man.mtool.work/fastapi/0.115/advanced/openapi-webhooks/
- Templates 8309
- 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
...in the path operation that will return a template. Use the templates you created to render and return a TemplateResponse , pass the name of the template, the request object, and a "context" dictionary with key-value pairs to be used inside of the Jin...108.0, Starlette 0.29.0, the name was the first parameter. Also, before 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...plate Context Values In the HTML that contains: Item ID: {{ id }} ...it will show the id taken from the "context" dict you passed: { "id" : id } For example, with an ID of 42 , this would render: Item ID: 42 Template url_for Arguments You can also us... - https://man.mtool.work/fastapi/0.115/advanced/templates/