├── .github ├── DISCUSSION_TEMPLATE │ └── questions.yml ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ └── privileged.yml ├── actions │ ├── notify-translations │ │ ├── Dockerfile │ │ ├── action.yml │ │ └── app │ │ │ └── main.py │ └── people │ │ ├── Dockerfile │ │ ├── action.yml │ │ └── app │ │ └── main.py ├── dependabot.yml ├── labeler.yml └── workflows │ ├── add-to-project.yml │ ├── build-docs.yml │ ├── contributors.yml │ ├── deploy-docs.yml │ ├── issue-manager.yml │ ├── label-approved.yml │ ├── labeler.yml │ ├── latest-changes.yml │ ├── notify-translations.yml │ ├── people.yml │ ├── publish.yml │ ├── smokeshow.yml │ ├── test-redistribute.yml │ ├── test.yml │ └── topic-repos.yml ├── .gitignore ├── .pre-commit-config.yaml ├── CITATION.cff ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── docs ├── az │ ├── docs │ │ ├── index.md │ │ └── learn │ │ │ └── index.md │ └── mkdocs.yml ├── bn │ ├── docs │ │ ├── index.md │ │ ├── learn │ │ │ └── index.md │ │ └── python-types.md │ └── mkdocs.yml ├── de │ ├── docs │ │ ├── about │ │ │ └── index.md │ │ ├── advanced │ │ │ ├── additional-responses.md │ │ │ ├── additional-status-codes.md │ │ │ ├── advanced-dependencies.md │ │ │ ├── async-tests.md │ │ │ ├── behind-a-proxy.md │ │ │ ├── custom-response.md │ │ │ ├── dataclasses.md │ │ │ ├── events.md │ │ │ ├── generate-clients.md │ │ │ ├── index.md │ │ │ ├── middleware.md │ │ │ ├── openapi-callbacks.md │ │ │ ├── openapi-webhooks.md │ │ │ ├── path-operation-advanced-configuration.md │ │ │ ├── response-change-status-code.md │ │ │ ├── response-cookies.md │ │ │ ├── response-directly.md │ │ │ ├── response-headers.md │ │ │ ├── security │ │ │ │ ├── http-basic-auth.md │ │ │ │ ├── index.md │ │ │ │ └── oauth2-scopes.md │ │ │ ├── settings.md │ │ │ ├── sub-applications.md │ │ │ ├── templates.md │ │ │ ├── testing-dependencies.md │ │ │ ├── testing-events.md │ │ │ ├── testing-websockets.md │ │ │ ├── using-request-directly.md │ │ │ ├── websockets.md │ │ │ └── wsgi.md │ │ ├── alternatives.md │ │ ├── async.md │ │ ├── benchmarks.md │ │ ├── deployment │ │ │ ├── cloud.md │ │ │ ├── concepts.md │ │ │ ├── docker.md │ │ │ ├── https.md │ │ │ ├── index.md │ │ │ ├── manually.md │ │ │ ├── server-workers.md │ │ │ └── versions.md │ │ ├── features.md │ │ ├── help-fastapi.md │ │ ├── history-design-future.md │ │ ├── how-to │ │ │ ├── conditional-openapi.md │ │ │ ├── configure-swagger-ui.md │ │ │ ├── custom-docs-ui-assets.md │ │ │ ├── custom-request-and-route.md │ │ │ ├── extending-openapi.md │ │ │ ├── general.md │ │ │ ├── graphql.md │ │ │ ├── index.md │ │ │ └── separate-openapi-schemas.md │ │ ├── index.md │ │ ├── learn │ │ │ └── index.md │ │ ├── project-generation.md │ │ ├── python-types.md │ │ ├── resources │ │ │ └── index.md │ │ └── tutorial │ │ │ ├── background-tasks.md │ │ │ ├── bigger-applications.md │ │ │ ├── body-fields.md │ │ │ ├── body-multiple-params.md │ │ │ ├── body-nested-models.md │ │ │ ├── body-updates.md │ │ │ ├── body.md │ │ │ ├── cookie-params.md │ │ │ ├── dependencies │ │ │ ├── classes-as-dependencies.md │ │ │ ├── dependencies-in-path-operation-decorators.md │ │ │ ├── dependencies-with-yield.md │ │ │ ├── global-dependencies.md │ │ │ ├── index.md │ │ │ └── sub-dependencies.md │ │ │ ├── encoder.md │ │ │ ├── extra-data-types.md │ │ │ ├── extra-models.md │ │ │ ├── first-steps.md │ │ │ ├── handling-errors.md │ │ │ ├── header-params.md │ │ │ ├── index.md │ │ │ ├── metadata.md │ │ │ ├── middleware.md │ │ │ ├── path-operation-configuration.md │ │ │ ├── path-params-numeric-validations.md │ │ │ ├── path-params.md │ │ │ ├── query-params-str-validations.md │ │ │ ├── query-params.md │ │ │ ├── request-files.md │ │ │ ├── request-forms-and-files.md │ │ │ ├── request-forms.md │ │ │ ├── response-model.md │ │ │ ├── response-status-code.md │ │ │ ├── schema-extra-example.md │ │ │ ├── security │ │ │ ├── first-steps.md │ │ │ ├── get-current-user.md │ │ │ ├── index.md │ │ │ ├── oauth2-jwt.md │ │ │ └── simple-oauth2.md │ │ │ ├── static-files.md │ │ │ └── testing.md │ └── mkdocs.yml ├── em │ ├── docs │ │ ├── advanced │ │ │ ├── additional-responses.md │ │ │ ├── additional-status-codes.md │ │ │ ├── advanced-dependencies.md │ │ │ ├── async-tests.md │ │ │ ├── behind-a-proxy.md │ │ │ ├── custom-response.md │ │ │ ├── dataclasses.md │ │ │ ├── events.md │ │ │ ├── generate-clients.md │ │ │ ├── index.md │ │ │ ├── middleware.md │ │ │ ├── openapi-callbacks.md │ │ │ ├── path-operation-advanced-configuration.md │ │ │ ├── response-change-status-code.md │ │ │ ├── response-cookies.md │ │ │ ├── response-directly.md │ │ │ ├── response-headers.md │ │ │ ├── security │ │ │ │ ├── http-basic-auth.md │ │ │ │ ├── index.md │ │ │ │ └── oauth2-scopes.md │ │ │ ├── settings.md │ │ │ ├── sub-applications.md │ │ │ ├── templates.md │ │ │ ├── testing-dependencies.md │ │ │ ├── testing-events.md │ │ │ ├── testing-websockets.md │ │ │ ├── using-request-directly.md │ │ │ ├── websockets.md │ │ │ └── wsgi.md │ │ ├── alternatives.md │ │ ├── async.md │ │ ├── benchmarks.md │ │ ├── deployment │ │ │ ├── concepts.md │ │ │ ├── docker.md │ │ │ ├── https.md │ │ │ ├── index.md │ │ │ ├── manually.md │ │ │ ├── server-workers.md │ │ │ └── versions.md │ │ ├── features.md │ │ ├── help-fastapi.md │ │ ├── history-design-future.md │ │ ├── how-to │ │ │ ├── conditional-openapi.md │ │ │ ├── custom-request-and-route.md │ │ │ ├── extending-openapi.md │ │ │ └── graphql.md │ │ ├── index.md │ │ ├── project-generation.md │ │ ├── python-types.md │ │ └── tutorial │ │ │ ├── background-tasks.md │ │ │ ├── bigger-applications.md │ │ │ ├── body-fields.md │ │ │ ├── body-multiple-params.md │ │ │ ├── body-nested-models.md │ │ │ ├── body-updates.md │ │ │ ├── body.md │ │ │ ├── cookie-params.md │ │ │ ├── cors.md │ │ │ ├── debugging.md │ │ │ ├── dependencies │ │ │ ├── classes-as-dependencies.md │ │ │ ├── dependencies-in-path-operation-decorators.md │ │ │ ├── dependencies-with-yield.md │ │ │ ├── global-dependencies.md │ │ │ ├── index.md │ │ │ └── sub-dependencies.md │ │ │ ├── encoder.md │ │ │ ├── extra-data-types.md │ │ │ ├── extra-models.md │ │ │ ├── first-steps.md │ │ │ ├── handling-errors.md │ │ │ ├── header-params.md │ │ │ ├── index.md │ │ │ ├── metadata.md │ │ │ ├── middleware.md │ │ │ ├── path-operation-configuration.md │ │ │ ├── path-params-numeric-validations.md │ │ │ ├── path-params.md │ │ │ ├── query-params-str-validations.md │ │ │ ├── query-params.md │ │ │ ├── request-files.md │ │ │ ├── request-forms-and-files.md │ │ │ ├── request-forms.md │ │ │ ├── response-model.md │ │ │ ├── response-status-code.md │ │ │ ├── schema-extra-example.md │ │ │ ├── security │ │ │ ├── first-steps.md │ │ │ ├── get-current-user.md │ │ │ ├── index.md │ │ │ ├── oauth2-jwt.md │ │ │ └── simple-oauth2.md │ │ │ ├── static-files.md │ │ │ └── testing.md │ └── mkdocs.yml ├── en │ ├── data │ │ ├── contributors.yml │ │ ├── external_links.yml │ │ ├── github_sponsors.yml │ │ ├── members.yml │ │ ├── people.yml │ │ ├── skip_users.yml │ │ ├── sponsors.yml │ │ ├── sponsors_badge.yml │ │ ├── topic_repos.yml │ │ ├── translation_reviewers.yml │ │ └── translators.yml │ ├── docs │ │ ├── about │ │ │ └── index.md │ │ ├── advanced │ │ │ ├── additional-responses.md │ │ │ ├── additional-status-codes.md │ │ │ ├── advanced-dependencies.md │ │ │ ├── async-tests.md │ │ │ ├── behind-a-proxy.md │ │ │ ├── custom-response.md │ │ │ ├── dataclasses.md │ │ │ ├── events.md │ │ │ ├── generate-clients.md │ │ │ ├── index.md │ │ │ ├── middleware.md │ │ │ ├── openapi-callbacks.md │ │ │ ├── openapi-webhooks.md │ │ │ ├── path-operation-advanced-configuration.md │ │ │ ├── response-change-status-code.md │ │ │ ├── response-cookies.md │ │ │ ├── response-directly.md │ │ │ ├── response-headers.md │ │ │ ├── security │ │ │ │ ├── http-basic-auth.md │ │ │ │ ├── index.md │ │ │ │ └── oauth2-scopes.md │ │ │ ├── settings.md │ │ │ ├── sub-applications.md │ │ │ ├── templates.md │ │ │ ├── testing-dependencies.md │ │ │ ├── testing-events.md │ │ │ ├── testing-websockets.md │ │ │ ├── using-request-directly.md │ │ │ ├── websockets.md │ │ │ └── wsgi.md │ │ ├── alternatives.md │ │ ├── async.md │ │ ├── benchmarks.md │ │ ├── contributing.md │ │ ├── css │ │ │ ├── custom.css │ │ │ └── termynal.css │ │ ├── deployment │ │ │ ├── cloud.md │ │ │ ├── concepts.md │ │ │ ├── docker.md │ │ │ ├── https.md │ │ │ ├── index.md │ │ │ ├── manually.md │ │ │ ├── server-workers.md │ │ │ └── versions.md │ │ ├── environment-variables.md │ │ ├── external-links.md │ │ ├── fastapi-cli.md │ │ ├── fastapi-people.md │ │ ├── features.md │ │ ├── help-fastapi.md │ │ ├── history-design-future.md │ │ ├── how-to │ │ │ ├── conditional-openapi.md │ │ │ ├── configure-swagger-ui.md │ │ │ ├── custom-docs-ui-assets.md │ │ │ ├── custom-request-and-route.md │ │ │ ├── extending-openapi.md │ │ │ ├── general.md │ │ │ ├── graphql.md │ │ │ ├── index.md │ │ │ ├── separate-openapi-schemas.md │ │ │ └── testing-database.md │ │ ├── img │ │ │ ├── async │ │ │ │ ├── concurrent-burgers │ │ │ │ │ ├── concurrent-burgers-01.png │ │ │ │ │ ├── concurrent-burgers-02.png │ │ │ │ │ ├── concurrent-burgers-03.png │ │ │ │ │ ├── concurrent-burgers-04.png │ │ │ │ │ ├── concurrent-burgers-05.png │ │ │ │ │ ├── concurrent-burgers-06.png │ │ │ │ │ └── concurrent-burgers-07.png │ │ │ │ └── parallel-burgers │ │ │ │ │ ├── parallel-burgers-01.png │ │ │ │ │ ├── parallel-burgers-02.png │ │ │ │ │ ├── parallel-burgers-03.png │ │ │ │ │ ├── parallel-burgers-04.png │ │ │ │ │ ├── parallel-burgers-05.png │ │ │ │ │ └── parallel-burgers-06.png │ │ │ ├── deployment │ │ │ │ ├── concepts │ │ │ │ │ ├── image01.png │ │ │ │ │ ├── process-ram.drawio │ │ │ │ │ └── process-ram.svg │ │ │ │ ├── deta │ │ │ │ │ ├── image01.png │ │ │ │ │ ├── image02.png │ │ │ │ │ ├── image03.png │ │ │ │ │ ├── image04.png │ │ │ │ │ ├── image05.png │ │ │ │ │ └── image06.png │ │ │ │ └── https │ │ │ │ │ ├── https.drawio │ │ │ │ │ ├── https.svg │ │ │ │ │ ├── https01.drawio │ │ │ │ │ ├── https01.svg │ │ │ │ │ ├── https02.drawio │ │ │ │ │ ├── https02.svg │ │ │ │ │ ├── https03.drawio │ │ │ │ │ ├── https03.svg │ │ │ │ │ ├── https04.drawio │ │ │ │ │ ├── https04.svg │ │ │ │ │ ├── https05.drawio │ │ │ │ │ ├── https05.svg │ │ │ │ │ ├── https06.drawio │ │ │ │ │ ├── https06.svg │ │ │ │ │ ├── https07.drawio │ │ │ │ │ ├── https07.svg │ │ │ │ │ ├── https08.drawio │ │ │ │ │ └── https08.svg │ │ │ ├── favicon.png │ │ │ ├── github-social-preview.png │ │ │ ├── github-social-preview.svg │ │ │ ├── icon-white.svg │ │ │ ├── index │ │ │ │ ├── index-01-swagger-ui-simple.png │ │ │ │ ├── index-02-redoc-simple.png │ │ │ │ ├── index-03-swagger-02.png │ │ │ │ ├── index-04-swagger-03.png │ │ │ │ ├── index-05-swagger-04.png │ │ │ │ └── index-06-redoc-02.png │ │ │ ├── logo-margin │ │ │ │ ├── logo-teal-vector.svg │ │ │ │ ├── logo-teal.png │ │ │ │ ├── logo-teal.svg │ │ │ │ └── logo-white-bg.png │ │ │ ├── logo-teal-vector.svg │ │ │ ├── logo-teal.svg │ │ │ ├── pycharm-completion.png │ │ │ ├── python-types │ │ │ │ ├── image01.png │ │ │ │ ├── image02.png │ │ │ │ ├── image03.png │ │ │ │ ├── image04.png │ │ │ │ ├── image05.png │ │ │ │ └── image06.png │ │ │ ├── sponsors │ │ │ │ ├── blockbee-banner.png │ │ │ │ ├── blockbee.png │ │ │ │ ├── budget-insight.svg │ │ │ │ ├── bump-sh-banner.png │ │ │ │ ├── bump-sh-banner.svg │ │ │ │ ├── bump-sh.png │ │ │ │ ├── bump-sh.svg │ │ │ │ ├── calmcode.jpg │ │ │ │ ├── classiq-banner.png │ │ │ │ ├── classiq.png │ │ │ │ ├── codacy.png │ │ │ │ ├── coherence-banner.png │ │ │ │ ├── coherence.png │ │ │ │ ├── cryptapi-banner.svg │ │ │ │ ├── cryptapi.svg │ │ │ │ ├── databento.svg │ │ │ │ ├── deta-banner.svg │ │ │ │ ├── deta.svg │ │ │ │ ├── docarray-top-banner.svg │ │ │ │ ├── docarray.svg │ │ │ │ ├── doist-banner.svg │ │ │ │ ├── doist.svg │ │ │ │ ├── dropbase-banner.svg │ │ │ │ ├── dropbase.svg │ │ │ │ ├── exoflare.png │ │ │ │ ├── fastapi-course-bundle-banner.png │ │ │ │ ├── fastapi-course-bundle-banner.svg │ │ │ │ ├── fern-banner.png │ │ │ │ ├── fern-banner.svg │ │ │ │ ├── fern.png │ │ │ │ ├── fern.svg │ │ │ │ ├── fine-banner.png │ │ │ │ ├── fine.png │ │ │ │ ├── flint.png │ │ │ │ ├── haystack-fastapi.svg │ │ │ │ ├── imgwhale-banner.svg │ │ │ │ ├── imgwhale.svg │ │ │ │ ├── ines-course.jpg │ │ │ │ ├── investsuite.svg │ │ │ │ ├── jina-ai-banner.png │ │ │ │ ├── jina-ai.png │ │ │ │ ├── jina-banner.svg │ │ │ │ ├── jina-top-banner.svg │ │ │ │ ├── jina.svg │ │ │ │ ├── jina2.svg │ │ │ │ ├── kong-banner.png │ │ │ │ ├── kong.png │ │ │ │ ├── liblab-banner.png │ │ │ │ ├── liblab.png │ │ │ │ ├── mongodb-banner.png │ │ │ │ ├── mongodb.png │ │ │ │ ├── platform-sh-banner.png │ │ │ │ ├── platform-sh.png │ │ │ │ ├── porter-banner.png │ │ │ │ ├── porter.png │ │ │ │ ├── powens.png │ │ │ │ ├── propelauth-banner.png │ │ │ │ ├── propelauth.png │ │ │ │ ├── reflex-banner.png │ │ │ │ ├── reflex.png │ │ │ │ ├── render-banner.svg │ │ │ │ ├── render.svg │ │ │ │ ├── scalar-banner.svg │ │ │ │ ├── scalar.svg │ │ │ │ ├── speakeasy.png │ │ │ │ ├── stainless.png │ │ │ │ ├── striveworks-banner.png │ │ │ │ ├── striveworks.png │ │ │ │ ├── striveworks2.png │ │ │ │ ├── svix.svg │ │ │ │ ├── talkpython-v2.jpg │ │ │ │ ├── talkpython.png │ │ │ │ ├── testdriven.svg │ │ │ │ ├── vimso.png │ │ │ │ ├── wetransfer.svg │ │ │ │ ├── zuplo-banner.png │ │ │ │ └── zuplo.png │ │ │ ├── tutorial │ │ │ │ ├── additional-responses │ │ │ │ │ └── image01.png │ │ │ │ ├── async-sql-databases │ │ │ │ │ └── image01.png │ │ │ │ ├── behind-a-proxy │ │ │ │ │ ├── image01.png │ │ │ │ │ ├── image02.png │ │ │ │ │ └── image03.png │ │ │ │ ├── bigger-applications │ │ │ │ │ ├── image01.png │ │ │ │ │ ├── package.drawio │ │ │ │ │ └── package.svg │ │ │ │ ├── body-fields │ │ │ │ │ ├── image01.png │ │ │ │ │ └── image02.png │ │ │ │ ├── body-nested-models │ │ │ │ │ └── image01.png │ │ │ │ ├── body │ │ │ │ │ ├── image01.png │ │ │ │ │ ├── image02.png │ │ │ │ │ ├── image03.png │ │ │ │ │ ├── image04.png │ │ │ │ │ └── image05.png │ │ │ │ ├── cookie-param-models │ │ │ │ │ └── image01.png │ │ │ │ ├── custom-response │ │ │ │ │ └── image01.png │ │ │ │ ├── dataclasses │ │ │ │ │ └── image01.png │ │ │ │ ├── debugging │ │ │ │ │ ├── image01.png │ │ │ │ │ └── image02.png │ │ │ │ ├── dependencies │ │ │ │ │ ├── image01.png │ │ │ │ │ └── image02.png │ │ │ │ ├── extending-openapi │ │ │ │ │ ├── image01.png │ │ │ │ │ ├── image02.png │ │ │ │ │ ├── image03.png │ │ │ │ │ └── image04.png │ │ │ │ ├── generate-clients │ │ │ │ │ ├── image01.png │ │ │ │ │ ├── image02.png │ │ │ │ │ ├── image03.png │ │ │ │ │ ├── image04.png │ │ │ │ │ ├── image05.png │ │ │ │ │ ├── image06.png │ │ │ │ │ ├── image07.png │ │ │ │ │ └── image08.png │ │ │ │ ├── graphql │ │ │ │ │ └── image01.png │ │ │ │ ├── header-param-models │ │ │ │ │ └── image01.png │ │ │ │ ├── metadata │ │ │ │ │ ├── image01.png │ │ │ │ │ └── image02.png │ │ │ │ ├── openapi-callbacks │ │ │ │ │ └── image01.png │ │ │ │ ├── openapi-webhooks │ │ │ │ │ └── image01.png │ │ │ │ ├── path-operation-advanced-configuration │ │ │ │ │ └── image01.png │ │ │ │ ├── path-operation-configuration │ │ │ │ │ ├── image01.png │ │ │ │ │ ├── image02.png │ │ │ │ │ ├── image03.png │ │ │ │ │ ├── image04.png │ │ │ │ │ └── image05.png │ │ │ │ ├── path-params │ │ │ │ │ ├── image01.png │ │ │ │ │ ├── image02.png │ │ │ │ │ └── image03.png │ │ │ │ ├── query-param-models │ │ │ │ │ └── image01.png │ │ │ │ ├── query-params-str-validations │ │ │ │ │ ├── image01.png │ │ │ │ │ └── image02.png │ │ │ │ ├── request-form-models │ │ │ │ │ └── image01.png │ │ │ │ ├── response-model │ │ │ │ │ ├── image01.png │ │ │ │ │ └── image02.png │ │ │ │ ├── response-status-code │ │ │ │ │ ├── image01.png │ │ │ │ │ └── image02.png │ │ │ │ ├── security │ │ │ │ │ ├── image01.png │ │ │ │ │ ├── image02.png │ │ │ │ │ ├── image03.png │ │ │ │ │ ├── image04.png │ │ │ │ │ ├── image05.png │ │ │ │ │ ├── image06.png │ │ │ │ │ ├── image07.png │ │ │ │ │ ├── image08.png │ │ │ │ │ ├── image09.png │ │ │ │ │ ├── image10.png │ │ │ │ │ ├── image11.png │ │ │ │ │ └── image12.png │ │ │ │ ├── separate-openapi-schemas │ │ │ │ │ ├── image01.png │ │ │ │ │ ├── image02.png │ │ │ │ │ ├── image03.png │ │ │ │ │ ├── image04.png │ │ │ │ │ └── image05.png │ │ │ │ ├── sql-databases │ │ │ │ │ ├── image01.png │ │ │ │ │ └── image02.png │ │ │ │ ├── sub-applications │ │ │ │ │ ├── image01.png │ │ │ │ │ └── image02.png │ │ │ │ └── websockets │ │ │ │ │ ├── image01.png │ │ │ │ │ ├── image02.png │ │ │ │ │ ├── image03.png │ │ │ │ │ ├── image04.png │ │ │ │ │ └── image05.png │ │ │ └── vscode-completion.png │ │ ├── index.md │ │ ├── js │ │ │ ├── custom.js │ │ │ └── termynal.js │ │ ├── learn │ │ │ └── index.md │ │ ├── management-tasks.md │ │ ├── management.md │ │ ├── newsletter.md │ │ ├── project-generation.md │ │ ├── python-types.md │ │ ├── reference │ │ │ ├── apirouter.md │ │ │ ├── background.md │ │ │ ├── dependencies.md │ │ │ ├── encoders.md │ │ │ ├── exceptions.md │ │ │ ├── fastapi.md │ │ │ ├── httpconnection.md │ │ │ ├── index.md │ │ │ ├── middleware.md │ │ │ ├── openapi │ │ │ │ ├── docs.md │ │ │ │ ├── index.md │ │ │ │ └── models.md │ │ │ ├── parameters.md │ │ │ ├── request.md │ │ │ ├── response.md │ │ │ ├── responses.md │ │ │ ├── security │ │ │ │ └── index.md │ │ │ ├── staticfiles.md │ │ │ ├── status.md │ │ │ ├── templating.md │ │ │ ├── testclient.md │ │ │ ├── uploadfile.md │ │ │ └── websockets.md │ │ ├── release-notes.md │ │ ├── resources │ │ │ └── index.md │ │ ├── tutorial │ │ │ ├── background-tasks.md │ │ │ ├── bigger-applications.md │ │ │ ├── body-fields.md │ │ │ ├── body-multiple-params.md │ │ │ ├── body-nested-models.md │ │ │ ├── body-updates.md │ │ │ ├── body.md │ │ │ ├── cookie-param-models.md │ │ │ ├── cookie-params.md │ │ │ ├── cors.md │ │ │ ├── debugging.md │ │ │ ├── dependencies │ │ │ │ ├── classes-as-dependencies.md │ │ │ │ ├── dependencies-in-path-operation-decorators.md │ │ │ │ ├── dependencies-with-yield.md │ │ │ │ ├── global-dependencies.md │ │ │ │ ├── index.md │ │ │ │ └── sub-dependencies.md │ │ │ ├── encoder.md │ │ │ ├── extra-data-types.md │ │ │ ├── extra-models.md │ │ │ ├── first-steps.md │ │ │ ├── handling-errors.md │ │ │ ├── header-param-models.md │ │ │ ├── header-params.md │ │ │ ├── index.md │ │ │ ├── metadata.md │ │ │ ├── middleware.md │ │ │ ├── path-operation-configuration.md │ │ │ ├── path-params-numeric-validations.md │ │ │ ├── path-params.md │ │ │ ├── query-param-models.md │ │ │ ├── query-params-str-validations.md │ │ │ ├── query-params.md │ │ │ ├── request-files.md │ │ │ ├── request-form-models.md │ │ │ ├── request-forms-and-files.md │ │ │ ├── request-forms.md │ │ │ ├── response-model.md │ │ │ ├── response-status-code.md │ │ │ ├── schema-extra-example.md │ │ │ ├── security │ │ │ │ ├── first-steps.md │ │ │ │ ├── get-current-user.md │ │ │ │ ├── index.md │ │ │ │ ├── oauth2-jwt.md │ │ │ │ └── simple-oauth2.md │ │ │ ├── sql-databases.md │ │ │ ├── static-files.md │ │ │ └── testing.md │ │ └── virtual-environments.md │ ├── mkdocs.insiders.yml │ ├── mkdocs.maybe-insiders.yml │ ├── mkdocs.no-insiders.yml │ ├── mkdocs.yml │ └── overrides │ │ ├── main.html │ │ └── partials │ │ └── copyright.html ├── es │ ├── docs │ │ ├── about │ │ │ └── index.md │ │ ├── advanced │ │ │ ├── additional-responses.md │ │ │ ├── additional-status-codes.md │ │ │ ├── advanced-dependencies.md │ │ │ ├── async-tests.md │ │ │ ├── behind-a-proxy.md │ │ │ ├── custom-response.md │ │ │ ├── dataclasses.md │ │ │ ├── events.md │ │ │ ├── generate-clients.md │ │ │ ├── index.md │ │ │ ├── middleware.md │ │ │ ├── openapi-callbacks.md │ │ │ ├── openapi-webhooks.md │ │ │ ├── path-operation-advanced-configuration.md │ │ │ ├── response-change-status-code.md │ │ │ ├── response-cookies.md │ │ │ ├── response-directly.md │ │ │ ├── response-headers.md │ │ │ ├── security │ │ │ │ ├── http-basic-auth.md │ │ │ │ ├── index.md │ │ │ │ └── oauth2-scopes.md │ │ │ ├── settings.md │ │ │ ├── sub-applications.md │ │ │ ├── templates.md │ │ │ ├── testing-dependencies.md │ │ │ ├── testing-events.md │ │ │ ├── testing-websockets.md │ │ │ ├── using-request-directly.md │ │ │ ├── websockets.md │ │ │ └── wsgi.md │ │ ├── alternatives.md │ │ ├── async.md │ │ ├── benchmarks.md │ │ ├── deployment │ │ │ ├── cloud.md │ │ │ ├── concepts.md │ │ │ ├── docker.md │ │ │ ├── https.md │ │ │ ├── index.md │ │ │ ├── manually.md │ │ │ ├── server-workers.md │ │ │ └── versions.md │ │ ├── environment-variables.md │ │ ├── fastapi-cli.md │ │ ├── features.md │ │ ├── help-fastapi.md │ │ ├── history-design-future.md │ │ ├── how-to │ │ │ ├── conditional-openapi.md │ │ │ ├── configure-swagger-ui.md │ │ │ ├── custom-docs-ui-assets.md │ │ │ ├── custom-request-and-route.md │ │ │ ├── extending-openapi.md │ │ │ ├── general.md │ │ │ ├── graphql.md │ │ │ ├── index.md │ │ │ ├── separate-openapi-schemas.md │ │ │ └── testing-database.md │ │ ├── index.md │ │ ├── learn │ │ │ └── index.md │ │ ├── project-generation.md │ │ ├── python-types.md │ │ ├── resources │ │ │ └── index.md │ │ ├── tutorial │ │ │ ├── background-tasks.md │ │ │ ├── bigger-applications.md │ │ │ ├── body-fields.md │ │ │ ├── body-multiple-params.md │ │ │ ├── body-nested-models.md │ │ │ ├── body-updates.md │ │ │ ├── body.md │ │ │ ├── cookie-param-models.md │ │ │ ├── cookie-params.md │ │ │ ├── cors.md │ │ │ ├── debugging.md │ │ │ ├── dependencies │ │ │ │ ├── classes-as-dependencies.md │ │ │ │ ├── dependencies-in-path-operation-decorators.md │ │ │ │ ├── dependencies-with-yield.md │ │ │ │ ├── global-dependencies.md │ │ │ │ ├── index.md │ │ │ │ └── sub-dependencies.md │ │ │ ├── encoder.md │ │ │ ├── extra-data-types.md │ │ │ ├── extra-models.md │ │ │ ├── first-steps.md │ │ │ ├── handling-errors.md │ │ │ ├── header-param-models.md │ │ │ ├── header-params.md │ │ │ ├── index.md │ │ │ ├── metadata.md │ │ │ ├── middleware.md │ │ │ ├── path-operation-configuration.md │ │ │ ├── path-params-numeric-validations.md │ │ │ ├── path-params.md │ │ │ ├── query-param-models.md │ │ │ ├── query-params-str-validations.md │ │ │ ├── query-params.md │ │ │ ├── request-files.md │ │ │ ├── request-form-models.md │ │ │ ├── request-forms-and-files.md │ │ │ ├── request-forms.md │ │ │ ├── response-model.md │ │ │ ├── response-status-code.md │ │ │ ├── schema-extra-example.md │ │ │ ├── security │ │ │ │ ├── first-steps.md │ │ │ │ ├── get-current-user.md │ │ │ │ ├── index.md │ │ │ │ ├── oauth2-jwt.md │ │ │ │ └── simple-oauth2.md │ │ │ ├── sql-databases.md │ │ │ ├── static-files.md │ │ │ └── testing.md │ │ └── virtual-environments.md │ ├── llm-prompt.md │ └── mkdocs.yml ├── fa │ ├── docs │ │ ├── advanced │ │ │ └── sub-applications.md │ │ ├── features.md │ │ ├── index.md │ │ └── tutorial │ │ │ ├── middleware.md │ │ │ └── security │ │ │ └── index.md │ └── mkdocs.yml ├── fr │ ├── docs │ │ ├── advanced │ │ │ ├── additional-responses.md │ │ │ ├── additional-status-codes.md │ │ │ ├── index.md │ │ │ ├── path-operation-advanced-configuration.md │ │ │ └── response-directly.md │ │ ├── alternatives.md │ │ ├── async.md │ │ ├── benchmarks.md │ │ ├── deployment │ │ │ ├── docker.md │ │ │ ├── https.md │ │ │ ├── index.md │ │ │ ├── manually.md │ │ │ └── versions.md │ │ ├── features.md │ │ ├── help-fastapi.md │ │ ├── history-design-future.md │ │ ├── index.md │ │ ├── learn │ │ │ └── index.md │ │ ├── project-generation.md │ │ ├── python-types.md │ │ └── tutorial │ │ │ ├── background-tasks.md │ │ │ ├── body-multiple-params.md │ │ │ ├── body.md │ │ │ ├── debugging.md │ │ │ ├── first-steps.md │ │ │ ├── index.md │ │ │ ├── path-params-numeric-validations.md │ │ │ ├── path-params.md │ │ │ ├── query-params-str-validations.md │ │ │ └── query-params.md │ └── mkdocs.yml ├── he │ ├── docs │ │ └── index.md │ └── mkdocs.yml ├── hu │ ├── docs │ │ └── index.md │ └── mkdocs.yml ├── id │ ├── docs │ │ ├── index.md │ │ └── tutorial │ │ │ ├── first-steps.md │ │ │ ├── index.md │ │ │ ├── path-params.md │ │ │ └── static-files.md │ └── mkdocs.yml ├── it │ ├── docs │ │ └── index.md │ └── mkdocs.yml ├── ja │ ├── docs │ │ ├── advanced │ │ │ ├── additional-status-codes.md │ │ │ ├── custom-response.md │ │ │ ├── index.md │ │ │ ├── path-operation-advanced-configuration.md │ │ │ ├── response-directly.md │ │ │ └── websockets.md │ │ ├── alternatives.md │ │ ├── async.md │ │ ├── benchmarks.md │ │ ├── deployment │ │ │ ├── concepts.md │ │ │ ├── docker.md │ │ │ ├── https.md │ │ │ ├── index.md │ │ │ ├── manually.md │ │ │ ├── server-workers.md │ │ │ └── versions.md │ │ ├── features.md │ │ ├── help-fastapi.md │ │ ├── history-design-future.md │ │ ├── how-to │ │ │ └── conditional-openapi.md │ │ ├── index.md │ │ ├── learn │ │ │ └── index.md │ │ ├── project-generation.md │ │ ├── python-types.md │ │ └── tutorial │ │ │ ├── background-tasks.md │ │ │ ├── body-fields.md │ │ │ ├── body-multiple-params.md │ │ │ ├── body-nested-models.md │ │ │ ├── body-updates.md │ │ │ ├── body.md │ │ │ ├── cookie-params.md │ │ │ ├── cors.md │ │ │ ├── debugging.md │ │ │ ├── dependencies │ │ │ ├── classes-as-dependencies.md │ │ │ ├── dependencies-in-path-operation-decorators.md │ │ │ ├── dependencies-with-yield.md │ │ │ ├── index.md │ │ │ └── sub-dependencies.md │ │ │ ├── encoder.md │ │ │ ├── extra-data-types.md │ │ │ ├── extra-models.md │ │ │ ├── first-steps.md │ │ │ ├── handling-errors.md │ │ │ ├── header-params.md │ │ │ ├── index.md │ │ │ ├── metadata.md │ │ │ ├── middleware.md │ │ │ ├── path-operation-configuration.md │ │ │ ├── path-params-numeric-validations.md │ │ │ ├── path-params.md │ │ │ ├── query-params-str-validations.md │ │ │ ├── query-params.md │ │ │ ├── request-forms-and-files.md │ │ │ ├── request-forms.md │ │ │ ├── response-model.md │ │ │ ├── response-status-code.md │ │ │ ├── schema-extra-example.md │ │ │ ├── security │ │ │ ├── first-steps.md │ │ │ ├── get-current-user.md │ │ │ ├── index.md │ │ │ └── oauth2-jwt.md │ │ │ ├── static-files.md │ │ │ └── testing.md │ └── mkdocs.yml ├── ko │ ├── docs │ │ ├── about │ │ │ └── index.md │ │ ├── advanced │ │ │ ├── additional-status-codes.md │ │ │ ├── advanced-dependencies.md │ │ │ ├── async-tests.md │ │ │ ├── events.md │ │ │ ├── index.md │ │ │ ├── middlewares.md │ │ │ ├── response-change-status-code.md │ │ │ ├── response-cookies.md │ │ │ ├── response-directly.md │ │ │ ├── response-headers.md │ │ │ ├── templates.md │ │ │ ├── testing-dependencies.md │ │ │ ├── testing-events.md │ │ │ ├── testing-websockets.md │ │ │ ├── using-request-directly.md │ │ │ ├── websockets.md │ │ │ └── wsgi.md │ │ ├── async.md │ │ ├── benchmarks.md │ │ ├── deployment │ │ │ ├── cloud.md │ │ │ ├── docker.md │ │ │ ├── index.md │ │ │ ├── server-workers.md │ │ │ └── versions.md │ │ ├── environment-variables.md │ │ ├── fastapi-cli.md │ │ ├── features.md │ │ ├── help-fastapi.md │ │ ├── history-design-future.md │ │ ├── how-to │ │ │ ├── conditional-openapi.md │ │ │ └── configure-swagger-ui.md │ │ ├── index.md │ │ ├── learn │ │ │ └── index.md │ │ ├── openapi-webhooks.md │ │ ├── project-generation.md │ │ ├── python-types.md │ │ ├── resources │ │ │ └── index.md │ │ ├── security │ │ │ └── index.md │ │ └── tutorial │ │ │ ├── background-tasks.md │ │ │ ├── body-fields.md │ │ │ ├── body-multiple-params.md │ │ │ ├── body-nested-models.md │ │ │ ├── body.md │ │ │ ├── cookie-param-models.md │ │ │ ├── cookie-params.md │ │ │ ├── cors.md │ │ │ ├── debugging.md │ │ │ ├── dependencies │ │ │ ├── classes-as-dependencies.md │ │ │ ├── dependencies-in-path-operation-decorators.md │ │ │ ├── global-dependencies.md │ │ │ └── index.md │ │ │ ├── encoder.md │ │ │ ├── extra-data-types.md │ │ │ ├── first-steps.md │ │ │ ├── header-param-models.md │ │ │ ├── header-params.md │ │ │ ├── index.md │ │ │ ├── metadata.md │ │ │ ├── middleware.md │ │ │ ├── path-operation-configuration.md │ │ │ ├── path-params-numeric-validations.md │ │ │ ├── path-params.md │ │ │ ├── query-param-models.md │ │ │ ├── query-params-str-validations.md │ │ │ ├── query-params.md │ │ │ ├── request-files.md │ │ │ ├── request-form-models.md │ │ │ ├── request-forms-and-files.md │ │ │ ├── request-forms.md │ │ │ ├── response-model.md │ │ │ ├── response-status-code.md │ │ │ ├── schema-extra-example.md │ │ │ ├── security │ │ │ ├── get-current-user.md │ │ │ └── simple-oauth2.md │ │ │ ├── sql-databases.md │ │ │ ├── static-files.md │ │ │ └── testing.md │ └── mkdocs.yml ├── language_names.yml ├── missing-translation.md ├── nl │ ├── docs │ │ ├── environment-variables.md │ │ ├── features.md │ │ ├── index.md │ │ └── python-types.md │ └── mkdocs.yml ├── pl │ ├── docs │ │ ├── features.md │ │ ├── help-fastapi.md │ │ ├── index.md │ │ └── tutorial │ │ │ ├── first-steps.md │ │ │ └── index.md │ └── mkdocs.yml ├── pt │ ├── docs │ │ ├── about │ │ │ └── index.md │ │ ├── advanced │ │ │ ├── additional-responses.md │ │ │ ├── additional-status-codes.md │ │ │ ├── advanced-dependencies.md │ │ │ ├── async-tests.md │ │ │ ├── behind-a-proxy.md │ │ │ ├── custom-response.md │ │ │ ├── dataclasses.md │ │ │ ├── events.md │ │ │ ├── generate-clients.md │ │ │ ├── index.md │ │ │ ├── middleware.md │ │ │ ├── openapi-callbacks.md │ │ │ ├── openapi-webhooks.md │ │ │ ├── path-operation-advanced-configuration.md │ │ │ ├── response-change-status-code.md │ │ │ ├── response-cookies.md │ │ │ ├── response-directly.md │ │ │ ├── response-headers.md │ │ │ ├── security │ │ │ │ ├── http-basic-auth.md │ │ │ │ ├── index.md │ │ │ │ └── oauth2-scopes.md │ │ │ ├── settings.md │ │ │ ├── sub-applications.md │ │ │ ├── templates.md │ │ │ ├── testing-dependencies.md │ │ │ ├── testing-events.md │ │ │ ├── testing-websockets.md │ │ │ ├── using-request-directly.md │ │ │ ├── websockets.md │ │ │ └── wsgi.md │ │ ├── alternatives.md │ │ ├── async.md │ │ ├── benchmarks.md │ │ ├── deployment │ │ │ ├── cloud.md │ │ │ ├── concepts.md │ │ │ ├── docker.md │ │ │ ├── https.md │ │ │ ├── index.md │ │ │ ├── manually.md │ │ │ ├── server-workers.md │ │ │ └── versions.md │ │ ├── environment-variables.md │ │ ├── fastapi-cli.md │ │ ├── features.md │ │ ├── help-fastapi.md │ │ ├── history-design-future.md │ │ ├── how-to │ │ │ ├── conditional-openapi.md │ │ │ ├── configure-swagger-ui.md │ │ │ ├── custom-docs-ui-assets.md │ │ │ ├── custom-request-and-route.md │ │ │ ├── extending-openapi.md │ │ │ ├── general.md │ │ │ ├── graphql.md │ │ │ ├── index.md │ │ │ ├── separate-openapi-schemas.md │ │ │ └── testing-database.md │ │ ├── index.md │ │ ├── learn │ │ │ └── index.md │ │ ├── project-generation.md │ │ ├── python-types.md │ │ ├── resources │ │ │ └── index.md │ │ ├── tutorial │ │ │ ├── background-tasks.md │ │ │ ├── bigger-applications.md │ │ │ ├── body-fields.md │ │ │ ├── body-multiple-params.md │ │ │ ├── body-nested-models.md │ │ │ ├── body-updates.md │ │ │ ├── body.md │ │ │ ├── cookie-param-models.md │ │ │ ├── cookie-params.md │ │ │ ├── cors.md │ │ │ ├── debugging.md │ │ │ ├── dependencies │ │ │ │ ├── classes-as-dependencies.md │ │ │ │ ├── dependencies-in-path-operation-decorators.md │ │ │ │ ├── dependencies-with-yield.md │ │ │ │ ├── global-dependencies.md │ │ │ │ ├── index.md │ │ │ │ └── sub-dependencies.md │ │ │ ├── encoder.md │ │ │ ├── extra-data-types.md │ │ │ ├── extra-models.md │ │ │ ├── first-steps.md │ │ │ ├── handling-errors.md │ │ │ ├── header-param-models.md │ │ │ ├── header-params.md │ │ │ ├── index.md │ │ │ ├── metadata.md │ │ │ ├── middleware.md │ │ │ ├── path-operation-configuration.md │ │ │ ├── path-params-numeric-validations.md │ │ │ ├── path-params.md │ │ │ ├── query-param-models.md │ │ │ ├── query-params-str-validations.md │ │ │ ├── query-params.md │ │ │ ├── request-files.md │ │ │ ├── request-form-models.md │ │ │ ├── request-forms-and-files.md │ │ │ ├── request-forms.md │ │ │ ├── request_files.md │ │ │ ├── response-model.md │ │ │ ├── response-status-code.md │ │ │ ├── schema-extra-example.md │ │ │ ├── security │ │ │ │ ├── first-steps.md │ │ │ │ ├── get-current-user.md │ │ │ │ ├── index.md │ │ │ │ └── simple-oauth2.md │ │ │ ├── sql-databases.md │ │ │ ├── static-files.md │ │ │ └── testing.md │ │ └── virtual-environments.md │ └── mkdocs.yml ├── ru │ ├── docs │ │ ├── about │ │ │ └── index.md │ │ ├── alternatives.md │ │ ├── async.md │ │ ├── benchmarks.md │ │ ├── deployment │ │ │ ├── concepts.md │ │ │ ├── docker.md │ │ │ ├── https.md │ │ │ ├── index.md │ │ │ ├── manually.md │ │ │ └── versions.md │ │ ├── environment-variables.md │ │ ├── fastapi-cli.md │ │ ├── features.md │ │ ├── help-fastapi.md │ │ ├── history-design-future.md │ │ ├── index.md │ │ ├── learn │ │ │ └── index.md │ │ ├── project-generation.md │ │ ├── python-types.md │ │ ├── tutorial │ │ │ ├── background-tasks.md │ │ │ ├── body-fields.md │ │ │ ├── body-multiple-params.md │ │ │ ├── body-nested-models.md │ │ │ ├── body-updates.md │ │ │ ├── body.md │ │ │ ├── cookie-params.md │ │ │ ├── cors.md │ │ │ ├── debugging.md │ │ │ ├── dependencies │ │ │ │ ├── classes-as-dependencies.md │ │ │ │ ├── dependencies-in-path-operation-decorators.md │ │ │ │ ├── dependencies-with-yield.md │ │ │ │ ├── global-dependencies.md │ │ │ │ ├── index.md │ │ │ │ └── sub-dependencies.md │ │ │ ├── encoder.md │ │ │ ├── extra-data-types.md │ │ │ ├── extra-models.md │ │ │ ├── first-steps.md │ │ │ ├── handling-errors.md │ │ │ ├── header-params.md │ │ │ ├── index.md │ │ │ ├── metadata.md │ │ │ ├── path-operation-configuration.md │ │ │ ├── path-params-numeric-validations.md │ │ │ ├── path-params.md │ │ │ ├── query-param-models.md │ │ │ ├── query-params-str-validations.md │ │ │ ├── query-params.md │ │ │ ├── request-files.md │ │ │ ├── request-forms-and-files.md │ │ │ ├── request-forms.md │ │ │ ├── response-model.md │ │ │ ├── response-status-code.md │ │ │ ├── schema-extra-example.md │ │ │ ├── security │ │ │ │ ├── first-steps.md │ │ │ │ ├── get-current-user.md │ │ │ │ ├── index.md │ │ │ │ ├── oauth2-jwt.md │ │ │ │ └── simple-oauth2.md │ │ │ ├── sql-databases.md │ │ │ ├── static-files.md │ │ │ └── testing.md │ │ └── virtual-environments.md │ └── mkdocs.yml ├── tr │ ├── docs │ │ ├── about │ │ │ └── index.md │ │ ├── advanced │ │ │ ├── index.md │ │ │ ├── security │ │ │ │ └── index.md │ │ │ ├── testing-websockets.md │ │ │ └── wsgi.md │ │ ├── alternatives.md │ │ ├── async.md │ │ ├── benchmarks.md │ │ ├── deployment │ │ │ ├── cloud.md │ │ │ └── index.md │ │ ├── features.md │ │ ├── history-design-future.md │ │ ├── how-to │ │ │ ├── general.md │ │ │ └── index.md │ │ ├── index.md │ │ ├── learn │ │ │ └── index.md │ │ ├── project-generation.md │ │ ├── python-types.md │ │ ├── resources │ │ │ └── index.md │ │ └── tutorial │ │ │ ├── cookie-params.md │ │ │ ├── first-steps.md │ │ │ ├── path-params.md │ │ │ ├── query-params.md │ │ │ ├── request-forms.md │ │ │ └── static-files.md │ └── mkdocs.yml ├── uk │ ├── docs │ │ ├── alternatives.md │ │ ├── fastapi-cli.md │ │ ├── index.md │ │ ├── python-types.md │ │ └── tutorial │ │ │ ├── body-fields.md │ │ │ ├── body.md │ │ │ ├── cookie-params.md │ │ │ ├── encoder.md │ │ │ ├── extra-data-types.md │ │ │ ├── first-steps.md │ │ │ └── index.md │ └── mkdocs.yml ├── ur │ ├── docs │ │ └── benchmarks.md │ └── mkdocs.yml ├── vi │ ├── docs │ │ ├── features.md │ │ ├── index.md │ │ ├── python-types.md │ │ └── tutorial │ │ │ ├── first-steps.md │ │ │ └── index.md │ └── mkdocs.yml ├── yo │ ├── docs │ │ └── index.md │ └── mkdocs.yml ├── zh-hant │ ├── docs │ │ ├── about │ │ │ └── index.md │ │ ├── async.md │ │ ├── benchmarks.md │ │ ├── deployment │ │ │ ├── cloud.md │ │ │ └── index.md │ │ ├── environment-variables.md │ │ ├── fastapi-cli.md │ │ ├── features.md │ │ ├── how-to │ │ │ └── index.md │ │ ├── index.md │ │ ├── learn │ │ │ └── index.md │ │ ├── resources │ │ │ └── index.md │ │ ├── tutorial │ │ │ ├── first-steps.md │ │ │ ├── index.md │ │ │ └── query-param-models.md │ │ └── virtual-environments.md │ └── mkdocs.yml └── zh │ ├── docs │ ├── advanced │ │ ├── additional-responses.md │ │ ├── additional-status-codes.md │ │ ├── advanced-dependencies.md │ │ ├── async-tests.md │ │ ├── behind-a-proxy.md │ │ ├── custom-response.md │ │ ├── dataclasses.md │ │ ├── events.md │ │ ├── generate-clients.md │ │ ├── index.md │ │ ├── middleware.md │ │ ├── openapi-callbacks.md │ │ ├── openapi-webhooks.md │ │ ├── path-operation-advanced-configuration.md │ │ ├── response-change-status-code.md │ │ ├── response-cookies.md │ │ ├── response-directly.md │ │ ├── response-headers.md │ │ ├── security │ │ │ ├── http-basic-auth.md │ │ │ ├── index.md │ │ │ └── oauth2-scopes.md │ │ ├── settings.md │ │ ├── sub-applications.md │ │ ├── templates.md │ │ ├── testing-dependencies.md │ │ ├── testing-events.md │ │ ├── testing-websockets.md │ │ ├── using-request-directly.md │ │ ├── websockets.md │ │ └── wsgi.md │ ├── async.md │ ├── benchmarks.md │ ├── deployment │ │ ├── cloud.md │ │ ├── concepts.md │ │ ├── docker.md │ │ ├── https.md │ │ ├── index.md │ │ ├── manually.md │ │ ├── server-workers.md │ │ └── versions.md │ ├── environment-variables.md │ ├── fastapi-cli.md │ ├── features.md │ ├── help-fastapi.md │ ├── history-design-future.md │ ├── how-to │ │ ├── configure-swagger-ui.md │ │ ├── general.md │ │ └── index.md │ ├── index.md │ ├── learn │ │ └── index.md │ ├── project-generation.md │ ├── python-types.md │ ├── tutorial │ │ ├── background-tasks.md │ │ ├── bigger-applications.md │ │ ├── body-fields.md │ │ ├── body-multiple-params.md │ │ ├── body-nested-models.md │ │ ├── body-updates.md │ │ ├── body.md │ │ ├── cookie-param-models.md │ │ ├── cookie-params.md │ │ ├── cors.md │ │ ├── debugging.md │ │ ├── dependencies │ │ │ ├── classes-as-dependencies.md │ │ │ ├── dependencies-in-path-operation-decorators.md │ │ │ ├── dependencies-with-yield.md │ │ │ ├── global-dependencies.md │ │ │ ├── index.md │ │ │ └── sub-dependencies.md │ │ ├── encoder.md │ │ ├── extra-data-types.md │ │ ├── extra-models.md │ │ ├── first-steps.md │ │ ├── handling-errors.md │ │ ├── header-param-models.md │ │ ├── header-params.md │ │ ├── index.md │ │ ├── metadata.md │ │ ├── middleware.md │ │ ├── path-operation-configuration.md │ │ ├── path-params-numeric-validations.md │ │ ├── path-params.md │ │ ├── query-param-models.md │ │ ├── query-params-str-validations.md │ │ ├── query-params.md │ │ ├── request-files.md │ │ ├── request-form-models.md │ │ ├── request-forms-and-files.md │ │ ├── request-forms.md │ │ ├── response-model.md │ │ ├── response-status-code.md │ │ ├── schema-extra-example.md │ │ ├── security │ │ │ ├── first-steps.md │ │ │ ├── get-current-user.md │ │ │ ├── index.md │ │ │ ├── oauth2-jwt.md │ │ │ └── simple-oauth2.md │ │ ├── sql-databases.md │ │ ├── static-files.md │ │ └── testing.md │ └── virtual-environments.md │ └── mkdocs.yml ├── docs_src ├── additional_responses │ ├── tutorial001.py │ ├── tutorial002.py │ ├── tutorial003.py │ └── tutorial004.py ├── additional_status_codes │ ├── tutorial001.py │ ├── tutorial001_an.py │ ├── tutorial001_an_py310.py │ ├── tutorial001_an_py39.py │ └── tutorial001_py310.py ├── advanced_middleware │ ├── tutorial001.py │ ├── tutorial002.py │ └── tutorial003.py ├── app_testing │ ├── __init__.py │ ├── app_b │ │ ├── __init__.py │ │ ├── main.py │ │ └── test_main.py │ ├── app_b_an │ │ ├── __init__.py │ │ ├── main.py │ │ └── test_main.py │ ├── app_b_an_py310 │ │ ├── __init__.py │ │ ├── main.py │ │ └── test_main.py │ ├── app_b_an_py39 │ │ ├── __init__.py │ │ ├── main.py │ │ └── test_main.py │ ├── app_b_py310 │ │ ├── __init__.py │ │ ├── main.py │ │ └── test_main.py │ ├── main.py │ ├── test_main.py │ ├── tutorial001.py │ ├── tutorial002.py │ └── tutorial003.py ├── async_tests │ ├── __init__.py │ ├── main.py │ └── test_main.py ├── background_tasks │ ├── tutorial001.py │ ├── tutorial002.py │ ├── tutorial002_an.py │ ├── tutorial002_an_py310.py │ ├── tutorial002_an_py39.py │ └── tutorial002_py310.py ├── behind_a_proxy │ ├── tutorial001.py │ ├── tutorial002.py │ ├── tutorial003.py │ └── tutorial004.py ├── bigger_applications │ ├── __init__.py │ ├── app │ │ ├── __init__.py │ │ ├── dependencies.py │ │ ├── internal │ │ │ ├── __init__.py │ │ │ └── admin.py │ │ ├── main.py │ │ └── routers │ │ │ ├── __init__.py │ │ │ ├── items.py │ │ │ └── users.py │ ├── app_an │ │ ├── __init__.py │ │ ├── dependencies.py │ │ ├── internal │ │ │ ├── __init__.py │ │ │ └── admin.py │ │ ├── main.py │ │ └── routers │ │ │ ├── __init__.py │ │ │ ├── items.py │ │ │ └── users.py │ └── app_an_py39 │ │ ├── __init__.py │ │ ├── dependencies.py │ │ ├── internal │ │ ├── __init__.py │ │ └── admin.py │ │ ├── main.py │ │ └── routers │ │ ├── __init__.py │ │ ├── items.py │ │ └── users.py ├── body │ ├── tutorial001.py │ ├── tutorial001_py310.py │ ├── tutorial002.py │ ├── tutorial002_py310.py │ ├── tutorial003.py │ ├── tutorial003_py310.py │ ├── tutorial004.py │ └── tutorial004_py310.py ├── body_fields │ ├── tutorial001.py │ ├── tutorial001_an.py │ ├── tutorial001_an_py310.py │ ├── tutorial001_an_py39.py │ └── tutorial001_py310.py ├── body_multiple_params │ ├── tutorial001.py │ ├── tutorial001_an.py │ ├── tutorial001_an_py310.py │ ├── tutorial001_an_py39.py │ ├── tutorial001_py310.py │ ├── tutorial002.py │ ├── tutorial002_py310.py │ ├── tutorial003.py │ ├── tutorial003_an.py │ ├── tutorial003_an_py310.py │ ├── tutorial003_an_py39.py │ ├── tutorial003_py310.py │ ├── tutorial004.py │ ├── tutorial004_an.py │ ├── tutorial004_an_py310.py │ ├── tutorial004_an_py39.py │ ├── tutorial004_py310.py │ ├── tutorial005.py │ ├── tutorial005_an.py │ ├── tutorial005_an_py310.py │ ├── tutorial005_an_py39.py │ └── tutorial005_py310.py ├── body_nested_models │ ├── tutorial001.py │ ├── tutorial001_py310.py │ ├── tutorial002.py │ ├── tutorial002_py310.py │ ├── tutorial002_py39.py │ ├── tutorial003.py │ ├── tutorial003_py310.py │ ├── tutorial003_py39.py │ ├── tutorial004.py │ ├── tutorial004_py310.py │ ├── tutorial004_py39.py │ ├── tutorial005.py │ ├── tutorial005_py310.py │ ├── tutorial005_py39.py │ ├── tutorial006.py │ ├── tutorial006_py310.py │ ├── tutorial006_py39.py │ ├── tutorial007.py │ ├── tutorial007_py310.py │ ├── tutorial007_py39.py │ ├── tutorial008.py │ ├── tutorial008_py39.py │ ├── tutorial009.py │ └── tutorial009_py39.py ├── body_updates │ ├── tutorial001.py │ ├── tutorial001_py310.py │ ├── tutorial001_py39.py │ ├── tutorial002.py │ ├── tutorial002_py310.py │ └── tutorial002_py39.py ├── conditional_openapi │ └── tutorial001.py ├── configure_swagger_ui │ ├── tutorial001.py │ ├── tutorial002.py │ └── tutorial003.py ├── cookie_param_models │ ├── tutorial001.py │ ├── tutorial001_an.py │ ├── tutorial001_an_py310.py │ ├── tutorial001_an_py39.py │ ├── tutorial001_py310.py │ ├── tutorial002.py │ ├── tutorial002_an.py │ ├── tutorial002_an_py310.py │ ├── tutorial002_an_py39.py │ ├── tutorial002_pv1.py │ ├── tutorial002_pv1_an.py │ ├── tutorial002_pv1_an_py310.py │ ├── tutorial002_pv1_an_py39.py │ ├── tutorial002_pv1_py310.py │ └── tutorial002_py310.py ├── cookie_params │ ├── tutorial001.py │ ├── tutorial001_an.py │ ├── tutorial001_an_py310.py │ ├── tutorial001_an_py39.py │ └── tutorial001_py310.py ├── cors │ └── tutorial001.py ├── custom_docs_ui │ ├── tutorial001.py │ └── tutorial002.py ├── custom_request_and_route │ ├── tutorial001.py │ ├── tutorial002.py │ └── tutorial003.py ├── custom_response │ ├── tutorial001.py │ ├── tutorial001b.py │ ├── tutorial002.py │ ├── tutorial003.py │ ├── tutorial004.py │ ├── tutorial005.py │ ├── tutorial006.py │ ├── tutorial006b.py │ ├── tutorial006c.py │ ├── tutorial007.py │ ├── tutorial008.py │ ├── tutorial009.py │ ├── tutorial009b.py │ ├── tutorial009c.py │ └── tutorial010.py ├── dataclasses │ ├── tutorial001.py │ ├── tutorial002.py │ └── tutorial003.py ├── debugging │ └── tutorial001.py ├── dependencies │ ├── tutorial001.py │ ├── tutorial001_02_an.py │ ├── tutorial001_02_an_py310.py │ ├── tutorial001_02_an_py39.py │ ├── tutorial001_an.py │ ├── tutorial001_an_py310.py │ ├── tutorial001_an_py39.py │ ├── tutorial001_py310.py │ ├── tutorial002.py │ ├── tutorial002_an.py │ ├── tutorial002_an_py310.py │ ├── tutorial002_an_py39.py │ ├── tutorial002_py310.py │ ├── tutorial003.py │ ├── tutorial003_an.py │ ├── tutorial003_an_py310.py │ ├── tutorial003_an_py39.py │ ├── tutorial003_py310.py │ ├── tutorial004.py │ ├── tutorial004_an.py │ ├── tutorial004_an_py310.py │ ├── tutorial004_an_py39.py │ ├── tutorial004_py310.py │ ├── tutorial005.py │ ├── tutorial005_an.py │ ├── tutorial005_an_py310.py │ ├── tutorial005_an_py39.py │ ├── tutorial005_py310.py │ ├── tutorial006.py │ ├── tutorial006_an.py │ ├── tutorial006_an_py39.py │ ├── tutorial007.py │ ├── tutorial008.py │ ├── tutorial008_an.py │ ├── tutorial008_an_py39.py │ ├── tutorial008b.py │ ├── tutorial008b_an.py │ ├── tutorial008b_an_py39.py │ ├── tutorial008c.py │ ├── tutorial008c_an.py │ ├── tutorial008c_an_py39.py │ ├── tutorial008d.py │ ├── tutorial008d_an.py │ ├── tutorial008d_an_py39.py │ ├── tutorial009.py │ ├── tutorial010.py │ ├── tutorial011.py │ ├── tutorial011_an.py │ ├── tutorial011_an_py39.py │ ├── tutorial012.py │ ├── tutorial012_an.py │ └── tutorial012_an_py39.py ├── dependency_testing │ ├── tutorial001.py │ ├── tutorial001_an.py │ ├── tutorial001_an_py310.py │ ├── tutorial001_an_py39.py │ └── tutorial001_py310.py ├── encoder │ ├── tutorial001.py │ └── tutorial001_py310.py ├── events │ ├── tutorial001.py │ ├── tutorial002.py │ └── tutorial003.py ├── extending_openapi │ └── tutorial001.py ├── extra_data_types │ ├── tutorial001.py │ ├── tutorial001_an.py │ ├── tutorial001_an_py310.py │ ├── tutorial001_an_py39.py │ └── tutorial001_py310.py ├── extra_models │ ├── tutorial001.py │ ├── tutorial001_py310.py │ ├── tutorial002.py │ ├── tutorial002_py310.py │ ├── tutorial003.py │ ├── tutorial003_py310.py │ ├── tutorial004.py │ ├── tutorial004_py39.py │ ├── tutorial005.py │ └── tutorial005_py39.py ├── first_steps │ ├── tutorial001.py │ ├── tutorial002.py │ └── tutorial003.py ├── generate_clients │ ├── tutorial001.py │ ├── tutorial001_py39.py │ ├── tutorial002.py │ ├── tutorial002_py39.py │ ├── tutorial003.py │ ├── tutorial003_py39.py │ ├── tutorial004.js │ └── tutorial004.py ├── graphql │ └── tutorial001.py ├── handling_errors │ ├── tutorial001.py │ ├── tutorial002.py │ ├── tutorial003.py │ ├── tutorial004.py │ ├── tutorial005.py │ └── tutorial006.py ├── header_param_models │ ├── tutorial001.py │ ├── tutorial001_an.py │ ├── tutorial001_an_py310.py │ ├── tutorial001_an_py39.py │ ├── tutorial001_py310.py │ ├── tutorial001_py39.py │ ├── tutorial002.py │ ├── tutorial002_an.py │ ├── tutorial002_an_py310.py │ ├── tutorial002_an_py39.py │ ├── tutorial002_pv1.py │ ├── tutorial002_pv1_an.py │ ├── tutorial002_pv1_an_py310.py │ ├── tutorial002_pv1_an_py39.py │ ├── tutorial002_pv1_py310.py │ ├── tutorial002_pv1_py39.py │ ├── tutorial002_py310.py │ └── tutorial002_py39.py ├── header_params │ ├── tutorial001.py │ ├── tutorial001_an.py │ ├── tutorial001_an_py310.py │ ├── tutorial001_an_py39.py │ ├── tutorial001_py310.py │ ├── tutorial002.py │ ├── tutorial002_an.py │ ├── tutorial002_an_py310.py │ ├── tutorial002_an_py39.py │ ├── tutorial002_py310.py │ ├── tutorial003.py │ ├── tutorial003_an.py │ ├── tutorial003_an_py310.py │ ├── tutorial003_an_py39.py │ ├── tutorial003_py310.py │ └── tutorial003_py39.py ├── metadata │ ├── tutorial001.py │ ├── tutorial001_1.py │ ├── tutorial002.py │ ├── tutorial003.py │ └── tutorial004.py ├── middleware │ └── tutorial001.py ├── openapi_callbacks │ └── tutorial001.py ├── openapi_webhooks │ └── tutorial001.py ├── path_operation_advanced_configuration │ ├── tutorial001.py │ ├── tutorial002.py │ ├── tutorial003.py │ ├── tutorial004.py │ ├── tutorial005.py │ ├── tutorial006.py │ ├── tutorial007.py │ └── tutorial007_pv1.py ├── path_operation_configuration │ ├── tutorial001.py │ ├── tutorial001_py310.py │ ├── tutorial001_py39.py │ ├── tutorial002.py │ ├── tutorial002_py310.py │ ├── tutorial002_py39.py │ ├── tutorial002b.py │ ├── tutorial003.py │ ├── tutorial003_py310.py │ ├── tutorial003_py39.py │ ├── tutorial004.py │ ├── tutorial004_py310.py │ ├── tutorial004_py39.py │ ├── tutorial005.py │ ├── tutorial005_py310.py │ ├── tutorial005_py39.py │ └── tutorial006.py ├── path_params │ ├── tutorial001.py │ ├── tutorial002.py │ ├── tutorial003.py │ ├── tutorial003b.py │ ├── tutorial004.py │ └── tutorial005.py ├── path_params_numeric_validations │ ├── tutorial001.py │ ├── tutorial001_an.py │ ├── tutorial001_an_py310.py │ ├── tutorial001_an_py39.py │ ├── tutorial001_py310.py │ ├── tutorial002.py │ ├── tutorial002_an.py │ ├── tutorial002_an_py39.py │ ├── tutorial003.py │ ├── tutorial003_an.py │ ├── tutorial003_an_py39.py │ ├── tutorial004.py │ ├── tutorial004_an.py │ ├── tutorial004_an_py39.py │ ├── tutorial005.py │ ├── tutorial005_an.py │ ├── tutorial005_an_py39.py │ ├── tutorial006.py │ ├── tutorial006_an.py │ └── tutorial006_an_py39.py ├── python_types │ ├── tutorial001.py │ ├── tutorial002.py │ ├── tutorial003.py │ ├── tutorial004.py │ ├── tutorial005.py │ ├── tutorial006.py │ ├── tutorial006_py39.py │ ├── tutorial007.py │ ├── tutorial007_py39.py │ ├── tutorial008.py │ ├── tutorial008_py39.py │ ├── tutorial008b.py │ ├── tutorial008b_py310.py │ ├── tutorial009.py │ ├── tutorial009_py310.py │ ├── tutorial009b.py │ ├── tutorial009c.py │ ├── tutorial009c_py310.py │ ├── tutorial010.py │ ├── tutorial011.py │ ├── tutorial011_py310.py │ ├── tutorial011_py39.py │ ├── tutorial012.py │ ├── tutorial013.py │ └── tutorial013_py39.py ├── query_param_models │ ├── tutorial001.py │ ├── tutorial001_an.py │ ├── tutorial001_an_py310.py │ ├── tutorial001_an_py39.py │ ├── tutorial001_py310.py │ ├── tutorial001_py39.py │ ├── tutorial002.py │ ├── tutorial002_an.py │ ├── tutorial002_an_py310.py │ ├── tutorial002_an_py39.py │ ├── tutorial002_pv1.py │ ├── tutorial002_pv1_an.py │ ├── tutorial002_pv1_an_py310.py │ ├── tutorial002_pv1_an_py39.py │ ├── tutorial002_pv1_py310.py │ ├── tutorial002_pv1_py39.py │ ├── tutorial002_py310.py │ └── tutorial002_py39.py ├── query_params │ ├── tutorial001.py │ ├── tutorial002.py │ ├── tutorial002_py310.py │ ├── tutorial003.py │ ├── tutorial003_py310.py │ ├── tutorial004.py │ ├── tutorial004_py310.py │ ├── tutorial005.py │ ├── tutorial006.py │ ├── tutorial006_py310.py │ └── tutorial006b.py ├── query_params_str_validations │ ├── tutorial001.py │ ├── tutorial001_py310.py │ ├── tutorial002.py │ ├── tutorial002_an.py │ ├── tutorial002_an_py310.py │ ├── tutorial002_py310.py │ ├── tutorial003.py │ ├── tutorial003_an.py │ ├── tutorial003_an_py310.py │ ├── tutorial003_an_py39.py │ ├── tutorial003_py310.py │ ├── tutorial004.py │ ├── tutorial004_an.py │ ├── tutorial004_an_py310.py │ ├── tutorial004_an_py39.py │ ├── tutorial004_py310.py │ ├── tutorial004_regex_an_py310.py │ ├── tutorial005.py │ ├── tutorial005_an.py │ ├── tutorial005_an_py39.py │ ├── tutorial006.py │ ├── tutorial006_an.py │ ├── tutorial006_an_py39.py │ ├── tutorial006b.py │ ├── tutorial006b_an.py │ ├── tutorial006b_an_py39.py │ ├── tutorial006c.py │ ├── tutorial006c_an.py │ ├── tutorial006c_an_py310.py │ ├── tutorial006c_an_py39.py │ ├── tutorial006c_py310.py │ ├── tutorial006d.py │ ├── tutorial006d_an.py │ ├── tutorial006d_an_py39.py │ ├── tutorial007.py │ ├── tutorial007_an.py │ ├── tutorial007_an_py310.py │ ├── tutorial007_an_py39.py │ ├── tutorial007_py310.py │ ├── tutorial008.py │ ├── tutorial008_an.py │ ├── tutorial008_an_py310.py │ ├── tutorial008_an_py39.py │ ├── tutorial008_py310.py │ ├── tutorial009.py │ ├── tutorial009_an.py │ ├── tutorial009_an_py310.py │ ├── tutorial009_an_py39.py │ ├── tutorial009_py310.py │ ├── tutorial010.py │ ├── tutorial010_an.py │ ├── tutorial010_an_py310.py │ ├── tutorial010_an_py39.py │ ├── tutorial010_py310.py │ ├── tutorial011.py │ ├── tutorial011_an.py │ ├── tutorial011_an_py310.py │ ├── tutorial011_an_py39.py │ ├── tutorial011_py310.py │ ├── tutorial011_py39.py │ ├── tutorial012.py │ ├── tutorial012_an.py │ ├── tutorial012_an_py39.py │ ├── tutorial012_py39.py │ ├── tutorial013.py │ ├── tutorial013_an.py │ ├── tutorial013_an_py39.py │ ├── tutorial014.py │ ├── tutorial014_an.py │ ├── tutorial014_an_py310.py │ ├── tutorial014_an_py39.py │ └── tutorial014_py310.py ├── request_files │ ├── tutorial001.py │ ├── tutorial001_02.py │ ├── tutorial001_02_an.py │ ├── tutorial001_02_an_py310.py │ ├── tutorial001_02_an_py39.py │ ├── tutorial001_02_py310.py │ ├── tutorial001_03.py │ ├── tutorial001_03_an.py │ ├── tutorial001_03_an_py39.py │ ├── tutorial001_an.py │ ├── tutorial001_an_py39.py │ ├── tutorial002.py │ ├── tutorial002_an.py │ ├── tutorial002_an_py39.py │ ├── tutorial002_py39.py │ ├── tutorial003.py │ ├── tutorial003_an.py │ ├── tutorial003_an_py39.py │ └── tutorial003_py39.py ├── request_form_models │ ├── tutorial001.py │ ├── tutorial001_an.py │ ├── tutorial001_an_py39.py │ ├── tutorial002.py │ ├── tutorial002_an.py │ ├── tutorial002_an_py39.py │ ├── tutorial002_pv1.py │ ├── tutorial002_pv1_an.py │ └── tutorial002_pv1_an_py39.py ├── request_forms │ ├── tutorial001.py │ ├── tutorial001_an.py │ └── tutorial001_an_py39.py ├── request_forms_and_files │ ├── tutorial001.py │ ├── tutorial001_an.py │ └── tutorial001_an_py39.py ├── response_change_status_code │ └── tutorial001.py ├── response_cookies │ ├── tutorial001.py │ └── tutorial002.py ├── response_directly │ ├── tutorial001.py │ └── tutorial002.py ├── response_headers │ ├── tutorial001.py │ └── tutorial002.py ├── response_model │ ├── tutorial001.py │ ├── tutorial001_01.py │ ├── tutorial001_01_py310.py │ ├── tutorial001_01_py39.py │ ├── tutorial001_py310.py │ ├── tutorial001_py39.py │ ├── tutorial002.py │ ├── tutorial002_py310.py │ ├── tutorial003.py │ ├── tutorial003_01.py │ ├── tutorial003_01_py310.py │ ├── tutorial003_02.py │ ├── tutorial003_03.py │ ├── tutorial003_04.py │ ├── tutorial003_04_py310.py │ ├── tutorial003_05.py │ ├── tutorial003_05_py310.py │ ├── tutorial003_py310.py │ ├── tutorial004.py │ ├── tutorial004_py310.py │ ├── tutorial004_py39.py │ ├── tutorial005.py │ ├── tutorial005_py310.py │ ├── tutorial006.py │ └── tutorial006_py310.py ├── response_status_code │ ├── tutorial001.py │ └── tutorial002.py ├── schema_extra_example │ ├── tutorial001.py │ ├── tutorial001_pv1.py │ ├── tutorial001_pv1_py310.py │ ├── tutorial001_py310.py │ ├── tutorial002.py │ ├── tutorial002_py310.py │ ├── tutorial003.py │ ├── tutorial003_an.py │ ├── tutorial003_an_py310.py │ ├── tutorial003_an_py39.py │ ├── tutorial003_py310.py │ ├── tutorial004.py │ ├── tutorial004_an.py │ ├── tutorial004_an_py310.py │ ├── tutorial004_an_py39.py │ ├── tutorial004_py310.py │ ├── tutorial005.py │ ├── tutorial005_an.py │ ├── tutorial005_an_py310.py │ ├── tutorial005_an_py39.py │ └── tutorial005_py310.py ├── security │ ├── tutorial001.py │ ├── tutorial001_an.py │ ├── tutorial001_an_py39.py │ ├── tutorial002.py │ ├── tutorial002_an.py │ ├── tutorial002_an_py310.py │ ├── tutorial002_an_py39.py │ ├── tutorial002_py310.py │ ├── tutorial003.py │ ├── tutorial003_an.py │ ├── tutorial003_an_py310.py │ ├── tutorial003_an_py39.py │ ├── tutorial003_py310.py │ ├── tutorial004.py │ ├── tutorial004_an.py │ ├── tutorial004_an_py310.py │ ├── tutorial004_an_py39.py │ ├── tutorial004_py310.py │ ├── tutorial005.py │ ├── tutorial005_an.py │ ├── tutorial005_an_py310.py │ ├── tutorial005_an_py39.py │ ├── tutorial005_py310.py │ ├── tutorial005_py39.py │ ├── tutorial006.py │ ├── tutorial006_an.py │ ├── tutorial006_an_py39.py │ ├── tutorial007.py │ ├── tutorial007_an.py │ └── tutorial007_an_py39.py ├── separate_openapi_schemas │ ├── tutorial001.py │ ├── tutorial001_py310.py │ ├── tutorial001_py39.py │ ├── tutorial002.py │ ├── tutorial002_py310.py │ └── tutorial002_py39.py ├── settings │ ├── app01 │ │ ├── __init__.py │ │ ├── config.py │ │ └── main.py │ ├── app02 │ │ ├── __init__.py │ │ ├── config.py │ │ ├── main.py │ │ └── test_main.py │ ├── app02_an │ │ ├── __init__.py │ │ ├── config.py │ │ ├── main.py │ │ └── test_main.py │ ├── app02_an_py39 │ │ ├── __init__.py │ │ ├── config.py │ │ ├── main.py │ │ └── test_main.py │ ├── app03 │ │ ├── __init__.py │ │ ├── config.py │ │ └── main.py │ ├── app03_an │ │ ├── __init__.py │ │ ├── config.py │ │ ├── config_pv1.py │ │ └── main.py │ ├── app03_an_py39 │ │ ├── __init__.py │ │ ├── config.py │ │ └── main.py │ ├── tutorial001.py │ └── tutorial001_pv1.py ├── sql_databases │ ├── __init__.py │ ├── tutorial001.py │ ├── tutorial001_an.py │ ├── tutorial001_an_py310.py │ ├── tutorial001_an_py39.py │ ├── tutorial001_py310.py │ ├── tutorial001_py39.py │ ├── tutorial002.py │ ├── tutorial002_an.py │ ├── tutorial002_an_py310.py │ ├── tutorial002_an_py39.py │ ├── tutorial002_py310.py │ └── tutorial002_py39.py ├── static_files │ └── tutorial001.py ├── sub_applications │ └── tutorial001.py ├── templates │ ├── static │ │ └── styles.css │ ├── templates │ │ └── item.html │ └── tutorial001.py ├── using_request_directly │ └── tutorial001.py ├── websockets │ ├── __init__.py │ ├── tutorial001.py │ ├── tutorial002.py │ ├── tutorial002_an.py │ ├── tutorial002_an_py310.py │ ├── tutorial002_an_py39.py │ ├── tutorial002_py310.py │ ├── tutorial003.py │ └── tutorial003_py39.py └── wsgi │ └── tutorial001.py ├── fastapi ├── __init__.py ├── __main__.py ├── _compat.py ├── applications.py ├── background.py ├── cli.py ├── concurrency.py ├── datastructures.py ├── dependencies │ ├── __init__.py │ ├── models.py │ └── utils.py ├── encoders.py ├── exception_handlers.py ├── exceptions.py ├── logger.py ├── middleware │ ├── __init__.py │ ├── cors.py │ ├── gzip.py │ ├── httpsredirect.py │ ├── trustedhost.py │ └── wsgi.py ├── openapi │ ├── __init__.py │ ├── constants.py │ ├── docs.py │ ├── models.py │ └── utils.py ├── param_functions.py ├── params.py ├── py.typed ├── requests.py ├── responses.py ├── routing.py ├── security │ ├── __init__.py │ ├── api_key.py │ ├── base.py │ ├── http.py │ ├── oauth2.py │ ├── open_id_connect_url.py │ └── utils.py ├── staticfiles.py ├── templating.py ├── testclient.py ├── types.py ├── utils.py └── websockets.py ├── pdm_build.py ├── pyproject.toml ├── requirements-docs-insiders.txt ├── requirements-docs-tests.txt ├── requirements-docs.txt ├── requirements-github-actions.txt ├── requirements-tests.txt ├── requirements-translations.txt ├── requirements.txt ├── scripts ├── contributors.py ├── deploy_docs_status.py ├── docs.py ├── format.sh ├── label_approved.py ├── lint.sh ├── mkdocs_hooks.py ├── playwright │ ├── cookie_param_models │ │ └── image01.py │ ├── header_param_models │ │ └── image01.py │ ├── query_param_models │ │ └── image01.py │ ├── request_form_models │ │ └── image01.py │ ├── separate_openapi_schemas │ │ ├── image01.py │ │ ├── image02.py │ │ ├── image03.py │ │ ├── image04.py │ │ └── image05.py │ └── sql_databases │ │ ├── image01.py │ │ └── image02.py ├── test-cov-html.sh ├── test.sh ├── topic_repos.py └── translate.py └── tests ├── __init__.py ├── main.py ├── test_additional_properties.py ├── test_additional_properties_bool.py ├── test_additional_response_extra.py ├── test_additional_responses_bad.py ├── test_additional_responses_custom_model_in_callback.py ├── test_additional_responses_custom_validationerror.py ├── test_additional_responses_default_validationerror.py ├── test_additional_responses_response_class.py ├── test_additional_responses_router.py ├── test_allow_inf_nan_in_enforcing.py ├── test_ambiguous_params.py ├── test_annotated.py ├── test_application.py ├── test_callable_endpoint.py ├── test_compat.py ├── test_computed_fields.py ├── test_custom_middleware_exception.py ├── test_custom_route_class.py ├── test_custom_schema_fields.py ├── test_custom_swagger_ui_redirect.py ├── test_datastructures.py ├── test_datetime_custom_encoder.py ├── test_default_response_class.py ├── test_default_response_class_router.py ├── test_dependency_cache.py ├── test_dependency_class.py ├── test_dependency_contextmanager.py ├── test_dependency_contextvars.py ├── test_dependency_duplicates.py ├── test_dependency_normal_exceptions.py ├── test_dependency_overrides.py ├── test_dependency_security_overrides.py ├── test_deprecated_openapi_prefix.py ├── test_duplicate_models_openapi.py ├── test_empty_router.py ├── test_enforce_once_required_parameter.py ├── test_exception_handlers.py ├── test_extra_routes.py ├── test_fastapi_cli.py ├── test_filter_pydantic_sub_model ├── __init__.py ├── app_pv1.py └── test_filter_pydantic_sub_model_pv1.py ├── test_filter_pydantic_sub_model_pv2.py ├── test_forms_from_non_typing_sequences.py ├── test_forms_single_model.py ├── test_forms_single_param.py ├── test_generate_unique_id_function.py ├── test_generic_parameterless_depends.py ├── test_get_request_body.py ├── test_http_connection_injection.py ├── test_include_route.py ├── test_include_router_defaults_overrides.py ├── test_infer_param_optionality.py ├── test_inherited_custom_class.py ├── test_invalid_path_param.py ├── test_invalid_sequence_param.py ├── test_jsonable_encoder.py ├── test_local_docs.py ├── test_modules_same_name_body ├── __init__.py ├── app │ ├── __init__.py │ ├── a.py │ ├── b.py │ └── main.py └── test_main.py ├── test_multi_body_errors.py ├── test_multi_query_errors.py ├── test_multipart_installation.py ├── test_no_swagger_ui_redirect.py ├── test_openapi_examples.py ├── test_openapi_query_parameter_extension.py ├── test_openapi_route_extensions.py ├── test_openapi_separate_input_output_schemas.py ├── test_openapi_servers.py ├── test_operations_signatures.py ├── test_orjson_response_class.py ├── test_param_class.py ├── test_param_in_path_and_dependency.py ├── test_param_include_in_schema.py ├── test_params_repr.py ├── test_path.py ├── test_put_no_body.py ├── test_query.py ├── test_read_with_orm_mode.py ├── test_regex_deprecated_body.py ├── test_regex_deprecated_params.py ├── test_repeated_cookie_headers.py ├── test_repeated_dependency_schema.py ├── test_repeated_parameter_alias.py ├── test_reponse_set_reponse_code_empty.py ├── test_request_body_parameters_media_type.py ├── test_required_noneable.py ├── test_response_by_alias.py ├── test_response_change_status_code.py ├── test_response_class_no_mediatype.py ├── test_response_code_no_body.py ├── test_response_model_as_return_annotation.py ├── test_response_model_data_filter.py ├── test_response_model_data_filter_no_inheritance.py ├── test_response_model_include_exclude.py ├── test_response_model_invalid.py ├── test_response_model_sub_types.py ├── test_route_scope.py ├── test_router_events.py ├── test_router_prefix_with_template.py ├── test_router_redirect_slashes.py ├── test_schema_extra_examples.py ├── test_security_api_key_cookie.py ├── test_security_api_key_cookie_description.py ├── test_security_api_key_cookie_optional.py ├── test_security_api_key_header.py ├── test_security_api_key_header_description.py ├── test_security_api_key_header_optional.py ├── test_security_api_key_query.py ├── test_security_api_key_query_description.py ├── test_security_api_key_query_optional.py ├── test_security_http_base.py ├── test_security_http_base_description.py ├── test_security_http_base_optional.py ├── test_security_http_basic_optional.py ├── test_security_http_basic_realm.py ├── test_security_http_basic_realm_description.py ├── test_security_http_bearer.py ├── test_security_http_bearer_description.py ├── test_security_http_bearer_optional.py ├── test_security_http_digest.py ├── test_security_http_digest_description.py ├── test_security_http_digest_optional.py ├── test_security_oauth2.py ├── test_security_oauth2_authorization_code_bearer.py ├── test_security_oauth2_authorization_code_bearer_description.py ├── test_security_oauth2_optional.py ├── test_security_oauth2_optional_description.py ├── test_security_oauth2_password_bearer_optional.py ├── test_security_oauth2_password_bearer_optional_description.py ├── test_security_openid_connect.py ├── test_security_openid_connect_description.py ├── test_security_openid_connect_optional.py ├── test_serialize_response.py ├── test_serialize_response_dataclass.py ├── test_serialize_response_model.py ├── test_skip_defaults.py ├── test_starlette_exception.py ├── test_starlette_urlconvertors.py ├── test_sub_callbacks.py ├── test_swagger_ui_init_oauth.py ├── test_tuples.py ├── test_tutorial ├── __init__.py ├── test_additional_responses │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial002.py │ ├── test_tutorial003.py │ └── test_tutorial004.py ├── test_additional_status_codes │ ├── __init__.py │ └── test_tutorial001.py ├── test_advanced_middleware │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial002.py │ └── test_tutorial003.py ├── test_async_tests │ ├── __init__.py │ └── test_main.py ├── test_background_tasks │ ├── __init__.py │ ├── test_tutorial001.py │ └── test_tutorial002.py ├── test_behind_a_proxy │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial002.py │ ├── test_tutorial003.py │ └── test_tutorial004.py ├── test_bigger_applications │ ├── __init__.py │ └── test_main.py ├── test_body │ ├── __init__.py │ └── test_tutorial001.py ├── test_body_fields │ ├── __init__.py │ └── test_tutorial001.py ├── test_body_multiple_params │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial001_an.py │ ├── test_tutorial001_an_py310.py │ ├── test_tutorial001_an_py39.py │ ├── test_tutorial001_py310.py │ ├── test_tutorial003.py │ ├── test_tutorial003_an.py │ ├── test_tutorial003_an_py310.py │ ├── test_tutorial003_an_py39.py │ └── test_tutorial003_py310.py ├── test_body_nested_models │ ├── __init__.py │ ├── test_tutorial009.py │ └── test_tutorial009_py39.py ├── test_body_updates │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial001_py310.py │ └── test_tutorial001_py39.py ├── test_conditional_openapi │ ├── __init__.py │ └── test_tutorial001.py ├── test_configure_swagger_ui │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial002.py │ └── test_tutorial003.py ├── test_cookie_param_models │ ├── __init__.py │ ├── test_tutorial001.py │ └── test_tutorial002.py ├── test_cookie_params │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial001_an.py │ ├── test_tutorial001_an_py310.py │ ├── test_tutorial001_an_py39.py │ └── test_tutorial001_py310.py ├── test_cors │ ├── __init__.py │ └── test_tutorial001.py ├── test_custom_docs_ui │ ├── __init__.py │ ├── test_tutorial001.py │ └── test_tutorial002.py ├── test_custom_request_and_route │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial002.py │ └── test_tutorial003.py ├── test_custom_response │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial001b.py │ ├── test_tutorial004.py │ ├── test_tutorial005.py │ ├── test_tutorial006.py │ ├── test_tutorial006b.py │ ├── test_tutorial006c.py │ ├── test_tutorial007.py │ ├── test_tutorial008.py │ ├── test_tutorial009.py │ ├── test_tutorial009b.py │ └── test_tutorial009c.py ├── test_dataclasses │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial002.py │ └── test_tutorial003.py ├── test_dependencies │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial001_an.py │ ├── test_tutorial001_an_py310.py │ ├── test_tutorial001_an_py39.py │ ├── test_tutorial001_py310.py │ ├── test_tutorial004.py │ ├── test_tutorial004_an.py │ ├── test_tutorial004_an_py310.py │ ├── test_tutorial004_an_py39.py │ ├── test_tutorial004_py310.py │ ├── test_tutorial006.py │ ├── test_tutorial006_an.py │ ├── test_tutorial006_an_py39.py │ ├── test_tutorial008b.py │ ├── test_tutorial008b_an.py │ ├── test_tutorial008b_an_py39.py │ ├── test_tutorial008c.py │ ├── test_tutorial008c_an.py │ ├── test_tutorial008c_an_py39.py │ ├── test_tutorial008d.py │ ├── test_tutorial008d_an.py │ ├── test_tutorial008d_an_py39.py │ ├── test_tutorial012.py │ ├── test_tutorial012_an.py │ └── test_tutorial012_an_py39.py ├── test_events │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial002.py │ └── test_tutorial003.py ├── test_extending_openapi │ ├── __init__.py │ └── test_tutorial001.py ├── test_extra_data_types │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial001_an.py │ ├── test_tutorial001_an_py310.py │ ├── test_tutorial001_an_py39.py │ └── test_tutorial001_py310.py ├── test_extra_models │ ├── __init__.py │ ├── test_tutorial003.py │ ├── test_tutorial003_py310.py │ ├── test_tutorial004.py │ ├── test_tutorial004_py39.py │ ├── test_tutorial005.py │ └── test_tutorial005_py39.py ├── test_first_steps │ ├── __init__.py │ └── test_tutorial001.py ├── test_generate_clients │ ├── __init__.py │ └── test_tutorial003.py ├── test_handling_errors │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial002.py │ ├── test_tutorial003.py │ ├── test_tutorial004.py │ ├── test_tutorial005.py │ └── test_tutorial006.py ├── test_header_param_models │ ├── __init__.py │ ├── test_tutorial001.py │ └── test_tutorial002.py ├── test_header_params │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial001_an.py │ ├── test_tutorial001_an_py310.py │ ├── test_tutorial001_py310.py │ ├── test_tutorial002.py │ ├── test_tutorial002_an.py │ ├── test_tutorial002_an_py310.py │ ├── test_tutorial002_an_py39.py │ ├── test_tutorial002_py310.py │ ├── test_tutorial003.py │ ├── test_tutorial003_an.py │ ├── test_tutorial003_an_py310.py │ ├── test_tutorial003_an_py39.py │ └── test_tutorial003_py310.py ├── test_metadata │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial001_1.py │ └── test_tutorial004.py ├── test_openapi_callbacks │ ├── __init__.py │ └── test_tutorial001.py ├── test_openapi_webhooks │ ├── __init__.py │ └── test_tutorial001.py ├── test_path_operation_advanced_configurations │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial002.py │ ├── test_tutorial003.py │ ├── test_tutorial004.py │ ├── test_tutorial005.py │ ├── test_tutorial006.py │ ├── test_tutorial007.py │ └── test_tutorial007_pv1.py ├── test_path_operation_configurations │ ├── __init__.py │ ├── test_tutorial002b.py │ ├── test_tutorial005.py │ ├── test_tutorial005_py310.py │ ├── test_tutorial005_py39.py │ └── test_tutorial006.py ├── test_path_params │ ├── __init__.py │ ├── test_tutorial004.py │ └── test_tutorial005.py ├── test_query_param_models │ ├── __init__.py │ ├── test_tutorial001.py │ └── test_tutorial002.py ├── test_query_params │ ├── __init__.py │ ├── test_tutorial005.py │ ├── test_tutorial006.py │ └── test_tutorial006_py310.py ├── test_query_params_str_validations │ ├── __init__.py │ ├── test_tutorial010.py │ ├── test_tutorial010_an.py │ ├── test_tutorial010_an_py310.py │ ├── test_tutorial010_an_py39.py │ ├── test_tutorial010_py310.py │ ├── test_tutorial011.py │ ├── test_tutorial011_an.py │ ├── test_tutorial011_an_py310.py │ ├── test_tutorial011_an_py39.py │ ├── test_tutorial011_py310.py │ ├── test_tutorial011_py39.py │ ├── test_tutorial012.py │ ├── test_tutorial012_an.py │ ├── test_tutorial012_an_py39.py │ ├── test_tutorial012_py39.py │ ├── test_tutorial013.py │ ├── test_tutorial013_an.py │ ├── test_tutorial013_an_py39.py │ ├── test_tutorial014.py │ ├── test_tutorial014_an.py │ ├── test_tutorial014_an_py310.py │ ├── test_tutorial014_an_py39.py │ └── test_tutorial014_py310.py ├── test_request_files │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial001_02.py │ ├── test_tutorial001_02_an.py │ ├── test_tutorial001_02_an_py310.py │ ├── test_tutorial001_02_an_py39.py │ ├── test_tutorial001_02_py310.py │ ├── test_tutorial001_03.py │ ├── test_tutorial001_03_an.py │ ├── test_tutorial001_03_an_py39.py │ ├── test_tutorial001_an.py │ ├── test_tutorial001_an_py39.py │ ├── test_tutorial002.py │ ├── test_tutorial002_an.py │ ├── test_tutorial002_an_py39.py │ ├── test_tutorial002_py39.py │ ├── test_tutorial003.py │ ├── test_tutorial003_an.py │ ├── test_tutorial003_an_py39.py │ └── test_tutorial003_py39.py ├── test_request_form_models │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial001_an.py │ ├── test_tutorial001_an_py39.py │ ├── test_tutorial002.py │ ├── test_tutorial002_an.py │ ├── test_tutorial002_an_py39.py │ ├── test_tutorial002_pv1.py │ ├── test_tutorial002_pv1_an.py │ └── test_tutorial002_pv1_an_p39.py ├── test_request_forms │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial001_an.py │ └── test_tutorial001_an_py39.py ├── test_request_forms_and_files │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial001_an.py │ └── test_tutorial001_an_py39.py ├── test_response_change_status_code │ ├── __init__.py │ └── test_tutorial001.py ├── test_response_cookies │ ├── __init__.py │ ├── test_tutorial001.py │ └── test_tutorial002.py ├── test_response_headers │ ├── __init__.py │ ├── test_tutorial001.py │ └── test_tutorial002.py ├── test_response_model │ ├── __init__.py │ ├── test_tutorial003.py │ ├── test_tutorial003_01.py │ ├── test_tutorial003_01_py310.py │ ├── test_tutorial003_02.py │ ├── test_tutorial003_03.py │ ├── test_tutorial003_04.py │ ├── test_tutorial003_04_py310.py │ ├── test_tutorial003_05.py │ ├── test_tutorial003_05_py310.py │ ├── test_tutorial003_py310.py │ ├── test_tutorial004.py │ ├── test_tutorial004_py310.py │ ├── test_tutorial004_py39.py │ ├── test_tutorial005.py │ ├── test_tutorial005_py310.py │ ├── test_tutorial006.py │ └── test_tutorial006_py310.py ├── test_schema_extra_example │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial001_pv1.py │ ├── test_tutorial001_pv1_py310.py │ ├── test_tutorial001_py310.py │ ├── test_tutorial004.py │ ├── test_tutorial004_an.py │ ├── test_tutorial004_an_py310.py │ ├── test_tutorial004_an_py39.py │ ├── test_tutorial004_py310.py │ ├── test_tutorial005.py │ ├── test_tutorial005_an.py │ ├── test_tutorial005_an_py310.py │ ├── test_tutorial005_an_py39.py │ └── test_tutorial005_py310.py ├── test_security │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial001_an.py │ ├── test_tutorial001_an_py39.py │ ├── test_tutorial003.py │ ├── test_tutorial003_an.py │ ├── test_tutorial003_an_py310.py │ ├── test_tutorial003_an_py39.py │ ├── test_tutorial003_py310.py │ ├── test_tutorial005.py │ ├── test_tutorial005_an.py │ ├── test_tutorial005_an_py310.py │ ├── test_tutorial005_an_py39.py │ ├── test_tutorial005_py310.py │ ├── test_tutorial005_py39.py │ ├── test_tutorial006.py │ ├── test_tutorial006_an.py │ └── test_tutorial006_an_py39.py ├── test_separate_openapi_schemas │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial001_py310.py │ ├── test_tutorial001_py39.py │ ├── test_tutorial002.py │ ├── test_tutorial002_py310.py │ └── test_tutorial002_py39.py ├── test_settings │ ├── __init__.py │ ├── test_app02.py │ ├── test_tutorial001.py │ └── test_tutorial001_pv1.py ├── test_sql_databases │ ├── __init__.py │ ├── test_tutorial001.py │ └── test_tutorial002.py ├── test_sub_applications │ ├── __init__.py │ └── test_tutorial001.py ├── test_templates │ ├── __init__.py │ └── test_tutorial001.py ├── test_testing │ ├── __init__.py │ ├── test_main.py │ ├── test_main_b.py │ ├── test_main_b_an.py │ ├── test_main_b_an_py310.py │ ├── test_main_b_an_py39.py │ ├── test_main_b_py310.py │ ├── test_tutorial001.py │ ├── test_tutorial002.py │ └── test_tutorial003.py ├── test_testing_dependencies │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial001_an.py │ ├── test_tutorial001_an_py310.py │ ├── test_tutorial001_an_py39.py │ └── test_tutorial001_py310.py ├── test_websockets │ ├── __init__.py │ ├── test_tutorial001.py │ ├── test_tutorial002.py │ ├── test_tutorial002_an.py │ ├── test_tutorial002_an_py310.py │ ├── test_tutorial002_an_py39.py │ ├── test_tutorial002_py310.py │ ├── test_tutorial003.py │ └── test_tutorial003_py39.py └── test_wsgi │ ├── __init__.py │ └── test_tutorial001.py ├── test_typing_python39.py ├── test_union_body.py ├── test_union_inherited_body.py ├── test_validate_response.py ├── test_validate_response_dataclass.py ├── test_validate_response_recursive ├── __init__.py ├── app_pv1.py ├── app_pv2.py ├── test_validate_response_recursive_pv1.py └── test_validate_response_recursive_pv2.py ├── test_webhooks_security.py ├── test_ws_dependencies.py ├── test_ws_router.py └── utils.py /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [tiangolo] 2 | -------------------------------------------------------------------------------- /.github/actions/notify-translations/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9 2 | 3 | RUN pip install httpx PyGithub "pydantic==1.5.1" "pyyaml>=5.3.1,<6.0.0" 4 | 5 | COPY ./app /app 6 | 7 | CMD ["python", "/app/main.py"] 8 | -------------------------------------------------------------------------------- /.github/actions/notify-translations/action.yml: -------------------------------------------------------------------------------- 1 | name: "Notify Translations" 2 | description: "Notify in the issue for a translation when there's a new PR available" 3 | author: "Sebastián Ramírez " 4 | inputs: 5 | token: 6 | description: 'Token, to read the GitHub API. Can be passed in using {{ secrets.GITHUB_TOKEN }}' 7 | required: true 8 | runs: 9 | using: 'docker' 10 | image: 'Dockerfile' 11 | -------------------------------------------------------------------------------- /.github/actions/people/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9 2 | 3 | RUN pip install httpx PyGithub "pydantic==2.0.2" pydantic-settings "pyyaml>=5.3.1,<6.0.0" 4 | 5 | COPY ./app /app 6 | 7 | CMD ["python", "/app/main.py"] 8 | -------------------------------------------------------------------------------- /.github/actions/people/action.yml: -------------------------------------------------------------------------------- 1 | name: "Generate FastAPI People" 2 | description: "Generate the data for the FastAPI People page" 3 | author: "Sebastián Ramírez " 4 | inputs: 5 | token: 6 | description: 'User token, to read the GitHub API. Can be passed in using {{ secrets.FASTAPI_PEOPLE }}' 7 | required: true 8 | runs: 9 | using: 'docker' 10 | image: 'Dockerfile' 11 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | # GitHub Actions 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "daily" 8 | commit-message: 9 | prefix: ⬆ 10 | # Python 11 | - package-ecosystem: "pip" 12 | directory: "/" 13 | schedule: 14 | interval: "monthly" 15 | commit-message: 16 | prefix: ⬆ 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .ipynb_checkpoints 3 | .mypy_cache 4 | .vscode 5 | __pycache__ 6 | .pytest_cache 7 | htmlcov 8 | dist 9 | site 10 | .coverage* 11 | coverage.xml 12 | .netlify 13 | test.db 14 | log.txt 15 | Pipfile.lock 16 | env3.* 17 | env 18 | docs_build 19 | site_build 20 | venv 21 | docs.zip 22 | archive.zip 23 | 24 | # vim temporary files 25 | *~ 26 | .*.sw? 27 | .cache 28 | 29 | # macOS 30 | .DS_Store 31 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Please read the [Development - Contributing](https://fastapi.tiangolo.com/contributing/) guidelines in the documentation site. 2 | -------------------------------------------------------------------------------- /docs/az/docs/learn/index.md: -------------------------------------------------------------------------------- 1 | # Öyrən 2 | 3 | Burada **FastAPI** öyrənmək üçün giriş bölmələri və dərsliklər yer alır. 4 | 5 | Siz bunu kitab, kurs, FastAPI öyrənmək üçün rəsmi və tövsiyə olunan üsul hesab edə bilərsiniz. 😎 6 | -------------------------------------------------------------------------------- /docs/az/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/bn/docs/learn/index.md: -------------------------------------------------------------------------------- 1 | # শিখুন 2 | 3 | এখানে **FastAPI** শিখার জন্য প্রাথমিক বিভাগগুলি এবং টিউটোরিয়ালগুলি রয়েছে। 4 | 5 | আপনি এটিকে একটি **বই**, একটি **কোর্স**, এবং FastAPI শিখার **অফিসিয়াল** এবং প্রস্তাবিত উপায় বিবেচনা করতে পারেন। 😎 6 | -------------------------------------------------------------------------------- /docs/bn/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/de/docs/about/index.md: -------------------------------------------------------------------------------- 1 | # Über 2 | 3 | Über FastAPI, sein Design, seine Inspiration und mehr. 🤓 4 | -------------------------------------------------------------------------------- /docs/de/docs/advanced/testing-events.md: -------------------------------------------------------------------------------- 1 | # Events testen: Hochfahren – Herunterfahren 2 | 3 | Wenn Sie in Ihren Tests Ihre Event-Handler (`startup` und `shutdown`) ausführen wollen, können Sie den `TestClient` mit einer `with`-Anweisung verwenden: 4 | 5 | {* ../../docs_src/app_testing/tutorial003.py hl[9:12,20:24] *} 6 | -------------------------------------------------------------------------------- /docs/de/docs/learn/index.md: -------------------------------------------------------------------------------- 1 | # Lernen 2 | 3 | Hier finden Sie die einführenden Kapitel und Tutorials zum Erlernen von **FastAPI**. 4 | 5 | Sie könnten dies als **Buch**, als **Kurs**, als **offizielle** und empfohlene Methode zum Erlernen von FastAPI betrachten. 😎 6 | -------------------------------------------------------------------------------- /docs/de/docs/resources/index.md: -------------------------------------------------------------------------------- 1 | # Ressourcen 2 | 3 | Zusätzliche Ressourcen, externe Links, Artikel und mehr. ✈️ 4 | -------------------------------------------------------------------------------- /docs/de/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/em/docs/advanced/testing-events.md: -------------------------------------------------------------------------------- 1 | # 🔬 🎉: 🕴 - 🤫 2 | 3 | 🕐❔ 👆 💪 👆 🎉 🐕‍🦺 (`startup` & `shutdown`) 🏃 👆 💯, 👆 💪 ⚙️ `TestClient` ⏮️ `with` 📄: 4 | 5 | {* ../../docs_src/app_testing/tutorial003.py hl[9:12,20:24] *} 6 | -------------------------------------------------------------------------------- /docs/em/docs/advanced/testing-websockets.md: -------------------------------------------------------------------------------- 1 | # 🔬 *️⃣ 2 | 3 | 👆 💪 ⚙️ 🎏 `TestClient` 💯*️⃣. 4 | 5 | 👉, 👆 ⚙️ `TestClient` `with` 📄, 🔗*️⃣: 6 | 7 | {* ../../docs_src/app_testing/tutorial002.py hl[27:31] *} 8 | 9 | /// note 10 | 11 | 🌅 ℹ, ✅ 💃 🧾 🔬 *️⃣ . 12 | 13 | /// 14 | -------------------------------------------------------------------------------- /docs/em/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/en/data/skip_users.yml: -------------------------------------------------------------------------------- 1 | - tiangolo 2 | - codecov 3 | - github-actions 4 | - pre-commit-ci 5 | - dependabot 6 | -------------------------------------------------------------------------------- /docs/en/docs/about/index.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | About FastAPI, its design, inspiration and more. 🤓 4 | -------------------------------------------------------------------------------- /docs/en/docs/advanced/testing-events.md: -------------------------------------------------------------------------------- 1 | # Testing Events: startup - shutdown 2 | 3 | When you need your event handlers (`startup` and `shutdown`) to run in your tests, you can use the `TestClient` with a `with` statement: 4 | 5 | {* ../../docs_src/app_testing/tutorial003.py hl[9:12,20:24] *} 6 | -------------------------------------------------------------------------------- /docs/en/docs/img/async/concurrent-burgers/concurrent-burgers-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/async/concurrent-burgers/concurrent-burgers-01.png -------------------------------------------------------------------------------- /docs/en/docs/img/async/concurrent-burgers/concurrent-burgers-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/async/concurrent-burgers/concurrent-burgers-02.png -------------------------------------------------------------------------------- /docs/en/docs/img/async/concurrent-burgers/concurrent-burgers-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/async/concurrent-burgers/concurrent-burgers-03.png -------------------------------------------------------------------------------- /docs/en/docs/img/async/concurrent-burgers/concurrent-burgers-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/async/concurrent-burgers/concurrent-burgers-04.png -------------------------------------------------------------------------------- /docs/en/docs/img/async/concurrent-burgers/concurrent-burgers-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/async/concurrent-burgers/concurrent-burgers-05.png -------------------------------------------------------------------------------- /docs/en/docs/img/async/concurrent-burgers/concurrent-burgers-06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/async/concurrent-burgers/concurrent-burgers-06.png -------------------------------------------------------------------------------- /docs/en/docs/img/async/concurrent-burgers/concurrent-burgers-07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/async/concurrent-burgers/concurrent-burgers-07.png -------------------------------------------------------------------------------- /docs/en/docs/img/async/parallel-burgers/parallel-burgers-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/async/parallel-burgers/parallel-burgers-01.png -------------------------------------------------------------------------------- /docs/en/docs/img/async/parallel-burgers/parallel-burgers-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/async/parallel-burgers/parallel-burgers-02.png -------------------------------------------------------------------------------- /docs/en/docs/img/async/parallel-burgers/parallel-burgers-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/async/parallel-burgers/parallel-burgers-03.png -------------------------------------------------------------------------------- /docs/en/docs/img/async/parallel-burgers/parallel-burgers-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/async/parallel-burgers/parallel-burgers-04.png -------------------------------------------------------------------------------- /docs/en/docs/img/async/parallel-burgers/parallel-burgers-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/async/parallel-burgers/parallel-burgers-05.png -------------------------------------------------------------------------------- /docs/en/docs/img/async/parallel-burgers/parallel-burgers-06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/async/parallel-burgers/parallel-burgers-06.png -------------------------------------------------------------------------------- /docs/en/docs/img/deployment/concepts/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/deployment/concepts/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/deployment/deta/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/deployment/deta/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/deployment/deta/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/deployment/deta/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/deployment/deta/image03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/deployment/deta/image03.png -------------------------------------------------------------------------------- /docs/en/docs/img/deployment/deta/image04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/deployment/deta/image04.png -------------------------------------------------------------------------------- /docs/en/docs/img/deployment/deta/image05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/deployment/deta/image05.png -------------------------------------------------------------------------------- /docs/en/docs/img/deployment/deta/image06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/deployment/deta/image06.png -------------------------------------------------------------------------------- /docs/en/docs/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/favicon.png -------------------------------------------------------------------------------- /docs/en/docs/img/github-social-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/github-social-preview.png -------------------------------------------------------------------------------- /docs/en/docs/img/index/index-01-swagger-ui-simple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/index/index-01-swagger-ui-simple.png -------------------------------------------------------------------------------- /docs/en/docs/img/index/index-02-redoc-simple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/index/index-02-redoc-simple.png -------------------------------------------------------------------------------- /docs/en/docs/img/index/index-03-swagger-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/index/index-03-swagger-02.png -------------------------------------------------------------------------------- /docs/en/docs/img/index/index-04-swagger-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/index/index-04-swagger-03.png -------------------------------------------------------------------------------- /docs/en/docs/img/index/index-05-swagger-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/index/index-05-swagger-04.png -------------------------------------------------------------------------------- /docs/en/docs/img/index/index-06-redoc-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/index/index-06-redoc-02.png -------------------------------------------------------------------------------- /docs/en/docs/img/logo-margin/logo-teal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/logo-margin/logo-teal.png -------------------------------------------------------------------------------- /docs/en/docs/img/logo-margin/logo-white-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/logo-margin/logo-white-bg.png -------------------------------------------------------------------------------- /docs/en/docs/img/pycharm-completion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/pycharm-completion.png -------------------------------------------------------------------------------- /docs/en/docs/img/python-types/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/python-types/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/python-types/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/python-types/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/python-types/image03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/python-types/image03.png -------------------------------------------------------------------------------- /docs/en/docs/img/python-types/image04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/python-types/image04.png -------------------------------------------------------------------------------- /docs/en/docs/img/python-types/image05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/python-types/image05.png -------------------------------------------------------------------------------- /docs/en/docs/img/python-types/image06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/python-types/image06.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/blockbee-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/blockbee-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/blockbee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/blockbee.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/bump-sh-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/bump-sh-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/bump-sh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/bump-sh.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/calmcode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/calmcode.jpg -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/classiq-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/classiq-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/classiq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/classiq.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/codacy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/codacy.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/coherence-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/coherence-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/coherence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/coherence.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/exoflare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/exoflare.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/fastapi-course-bundle-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/fastapi-course-bundle-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/fern-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/fern-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/fern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/fern.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/fine-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/fine-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/fine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/fine.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/flint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/flint.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/ines-course.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/ines-course.jpg -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/jina-ai-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/jina-ai-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/jina-ai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/jina-ai.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/kong-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/kong-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/kong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/kong.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/liblab-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/liblab-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/liblab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/liblab.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/mongodb-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/mongodb-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/mongodb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/mongodb.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/platform-sh-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/platform-sh-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/platform-sh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/platform-sh.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/porter-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/porter-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/porter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/porter.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/powens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/powens.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/propelauth-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/propelauth-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/propelauth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/propelauth.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/reflex-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/reflex-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/reflex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/reflex.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/speakeasy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/speakeasy.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/stainless.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/stainless.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/striveworks-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/striveworks-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/striveworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/striveworks.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/striveworks2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/striveworks2.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/talkpython-v2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/talkpython-v2.jpg -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/talkpython.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/talkpython.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/vimso.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/vimso.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/zuplo-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/zuplo-banner.png -------------------------------------------------------------------------------- /docs/en/docs/img/sponsors/zuplo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/sponsors/zuplo.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/additional-responses/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/additional-responses/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/async-sql-databases/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/async-sql-databases/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/behind-a-proxy/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/behind-a-proxy/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/behind-a-proxy/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/behind-a-proxy/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/behind-a-proxy/image03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/behind-a-proxy/image03.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/bigger-applications/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/bigger-applications/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/body-fields/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/body-fields/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/body-fields/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/body-fields/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/body-nested-models/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/body-nested-models/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/body/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/body/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/body/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/body/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/body/image03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/body/image03.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/body/image04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/body/image04.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/body/image05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/body/image05.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/cookie-param-models/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/cookie-param-models/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/custom-response/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/custom-response/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/dataclasses/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/dataclasses/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/debugging/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/debugging/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/debugging/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/debugging/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/dependencies/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/dependencies/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/dependencies/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/dependencies/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/extending-openapi/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/extending-openapi/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/extending-openapi/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/extending-openapi/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/extending-openapi/image03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/extending-openapi/image03.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/extending-openapi/image04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/extending-openapi/image04.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/generate-clients/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/generate-clients/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/generate-clients/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/generate-clients/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/generate-clients/image03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/generate-clients/image03.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/generate-clients/image04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/generate-clients/image04.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/generate-clients/image05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/generate-clients/image05.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/generate-clients/image06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/generate-clients/image06.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/generate-clients/image07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/generate-clients/image07.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/generate-clients/image08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/generate-clients/image08.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/graphql/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/graphql/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/header-param-models/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/header-param-models/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/metadata/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/metadata/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/metadata/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/metadata/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/openapi-callbacks/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/openapi-callbacks/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/openapi-webhooks/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/openapi-webhooks/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/path-operation-advanced-configuration/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/path-operation-advanced-configuration/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/path-operation-configuration/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/path-operation-configuration/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/path-operation-configuration/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/path-operation-configuration/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/path-operation-configuration/image03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/path-operation-configuration/image03.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/path-operation-configuration/image04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/path-operation-configuration/image04.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/path-operation-configuration/image05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/path-operation-configuration/image05.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/path-params/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/path-params/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/path-params/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/path-params/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/path-params/image03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/path-params/image03.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/query-param-models/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/query-param-models/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/query-params-str-validations/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/query-params-str-validations/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/query-params-str-validations/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/query-params-str-validations/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/request-form-models/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/request-form-models/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/response-model/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/response-model/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/response-model/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/response-model/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/response-status-code/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/response-status-code/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/response-status-code/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/response-status-code/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/security/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/security/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/security/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/security/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/security/image03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/security/image03.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/security/image04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/security/image04.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/security/image05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/security/image05.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/security/image06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/security/image06.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/security/image07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/security/image07.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/security/image08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/security/image08.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/security/image09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/security/image09.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/security/image10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/security/image10.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/security/image11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/security/image11.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/security/image12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/security/image12.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/separate-openapi-schemas/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/separate-openapi-schemas/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/separate-openapi-schemas/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/separate-openapi-schemas/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/separate-openapi-schemas/image03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/separate-openapi-schemas/image03.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/separate-openapi-schemas/image04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/separate-openapi-schemas/image04.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/separate-openapi-schemas/image05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/separate-openapi-schemas/image05.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/sql-databases/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/sql-databases/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/sql-databases/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/sql-databases/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/sub-applications/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/sub-applications/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/sub-applications/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/sub-applications/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/websockets/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/websockets/image01.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/websockets/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/websockets/image02.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/websockets/image03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/websockets/image03.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/websockets/image04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/websockets/image04.png -------------------------------------------------------------------------------- /docs/en/docs/img/tutorial/websockets/image05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/tutorial/websockets/image05.png -------------------------------------------------------------------------------- /docs/en/docs/img/vscode-completion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/docs/img/vscode-completion.png -------------------------------------------------------------------------------- /docs/en/docs/learn/index.md: -------------------------------------------------------------------------------- 1 | # Learn 2 | 3 | Here are the introductory sections and the tutorials to learn **FastAPI**. 4 | 5 | You could consider this a **book**, a **course**, the **official** and recommended way to learn FastAPI. 😎 6 | -------------------------------------------------------------------------------- /docs/en/docs/newsletter.md: -------------------------------------------------------------------------------- 1 | # FastAPI and friends newsletter 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/en/docs/reference/background.md: -------------------------------------------------------------------------------- 1 | # Background Tasks - `BackgroundTasks` 2 | 3 | You can declare a parameter in a *path operation function* or dependency function with the type `BackgroundTasks`, and then you can use it to schedule the execution of background tasks after the response is sent. 4 | 5 | You can import it directly from `fastapi`: 6 | 7 | ```python 8 | from fastapi import BackgroundTasks 9 | ``` 10 | 11 | ::: fastapi.BackgroundTasks 12 | -------------------------------------------------------------------------------- /docs/en/docs/reference/encoders.md: -------------------------------------------------------------------------------- 1 | # Encoders - `jsonable_encoder` 2 | 3 | ::: fastapi.encoders.jsonable_encoder 4 | -------------------------------------------------------------------------------- /docs/en/docs/reference/httpconnection.md: -------------------------------------------------------------------------------- 1 | # `HTTPConnection` class 2 | 3 | When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a `Request` or a `WebSocket`. 4 | 5 | You can import it from `fastapi.requests`: 6 | 7 | ```python 8 | from fastapi.requests import HTTPConnection 9 | ``` 10 | 11 | ::: fastapi.requests.HTTPConnection 12 | -------------------------------------------------------------------------------- /docs/en/docs/reference/index.md: -------------------------------------------------------------------------------- 1 | # Reference 2 | 3 | Here's the reference or code API, the classes, functions, parameters, attributes, and 4 | all the FastAPI parts you can use in your applications. 5 | 6 | If you want to **learn FastAPI** you are much better off reading the 7 | [FastAPI Tutorial](https://fastapi.tiangolo.com/tutorial/). 8 | -------------------------------------------------------------------------------- /docs/en/docs/reference/openapi/docs.md: -------------------------------------------------------------------------------- 1 | # OpenAPI `docs` 2 | 3 | Utilities to handle OpenAPI automatic UI documentation, including Swagger UI (by default at `/docs`) and ReDoc (by default at `/redoc`). 4 | 5 | ::: fastapi.openapi.docs.get_swagger_ui_html 6 | 7 | ::: fastapi.openapi.docs.get_redoc_html 8 | 9 | ::: fastapi.openapi.docs.get_swagger_ui_oauth2_redirect_html 10 | 11 | ::: fastapi.openapi.docs.swagger_ui_default_parameters 12 | -------------------------------------------------------------------------------- /docs/en/docs/reference/openapi/index.md: -------------------------------------------------------------------------------- 1 | # OpenAPI 2 | 3 | There are several utilities to handle OpenAPI. 4 | 5 | You normally don't need to use them unless you have a specific advanced use case that requires it. 6 | -------------------------------------------------------------------------------- /docs/en/docs/reference/openapi/models.md: -------------------------------------------------------------------------------- 1 | # OpenAPI `models` 2 | 3 | OpenAPI Pydantic models used to generate and validate the generated OpenAPI. 4 | 5 | ::: fastapi.openapi.models 6 | -------------------------------------------------------------------------------- /docs/en/docs/reference/templating.md: -------------------------------------------------------------------------------- 1 | # Templating - `Jinja2Templates` 2 | 3 | You can use the `Jinja2Templates` class to render Jinja templates. 4 | 5 | Read more about it in the [FastAPI docs for Templates](https://fastapi.tiangolo.com/advanced/templates/). 6 | 7 | You can import it directly from `fastapi.templating`: 8 | 9 | ```python 10 | from fastapi.templating import Jinja2Templates 11 | ``` 12 | 13 | ::: fastapi.templating.Jinja2Templates 14 | -------------------------------------------------------------------------------- /docs/en/docs/resources/index.md: -------------------------------------------------------------------------------- 1 | # Resources 2 | 3 | Additional resources, external links, articles and more. ✈️ 4 | -------------------------------------------------------------------------------- /docs/en/mkdocs.insiders.yml: -------------------------------------------------------------------------------- 1 | plugins: 2 | social: 3 | cards_layout_options: 4 | logo: ../en/docs/img/icon-white.svg 5 | typeset: 6 | markdown_extensions: 7 | material.extensions.preview: 8 | targets: 9 | include: 10 | - "*" 11 | -------------------------------------------------------------------------------- /docs/en/mkdocs.maybe-insiders.yml: -------------------------------------------------------------------------------- 1 | # Define this here and not in the main mkdocs.yml file because that one is auto 2 | # updated and written, and the script would remove the env var 3 | INHERIT: !ENV [INSIDERS_FILE, '../en/mkdocs.no-insiders.yml'] 4 | markdown_extensions: 5 | pymdownx.highlight: 6 | linenums: !ENV [LINENUMS, false] 7 | -------------------------------------------------------------------------------- /docs/en/mkdocs.no-insiders.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs/en/mkdocs.no-insiders.yml -------------------------------------------------------------------------------- /docs/es/docs/about/index.md: -------------------------------------------------------------------------------- 1 | # Acerca de 2 | 3 | Acerca de FastAPI, su diseño, inspiración y más. 🤓 4 | -------------------------------------------------------------------------------- /docs/es/docs/advanced/testing-events.md: -------------------------------------------------------------------------------- 1 | # Testing Events: startup - shutdown 2 | 3 | Cuando necesitas que tus manejadores de eventos (`startup` y `shutdown`) se ejecuten en tus tests, puedes usar el `TestClient` con un statement `with`: 4 | 5 | {* ../../docs_src/app_testing/tutorial003.py hl[9:12,20:24] *} 6 | -------------------------------------------------------------------------------- /docs/es/docs/learn/index.md: -------------------------------------------------------------------------------- 1 | # Aprende 2 | 3 | Aquí están las secciones introductorias y los tutoriales para aprender **FastAPI**. 4 | 5 | Podrías considerar esto un **libro**, un **curso**, la forma **oficial** y recomendada de aprender FastAPI. 😎 6 | -------------------------------------------------------------------------------- /docs/es/docs/resources/index.md: -------------------------------------------------------------------------------- 1 | # Recursos 2 | 3 | Recursos adicionales, enlaces externos, artículos y más. ✈️ 4 | -------------------------------------------------------------------------------- /docs/es/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/fa/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/fr/docs/learn/index.md: -------------------------------------------------------------------------------- 1 | # Apprendre 2 | 3 | Voici les sections introductives et les tutoriels pour apprendre **FastAPI**. 4 | 5 | Vous pouvez considérer ceci comme un **manuel**, un **cours**, la **méthode officielle** et recommandée pour appréhender FastAPI. 😎 6 | -------------------------------------------------------------------------------- /docs/fr/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/he/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/hu/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/id/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/it/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/ja/docs/deployment/index.md: -------------------------------------------------------------------------------- 1 | # デプロイ 2 | 3 | **FastAPI** 製のアプリケーションは比較的容易にデプロイできます。 4 | 5 | ユースケースや使用しているツールによっていくつかの方法に分かれます。 6 | 7 | 次のセクションでより詳しくそれらの方法について説明します。 8 | -------------------------------------------------------------------------------- /docs/ja/docs/learn/index.md: -------------------------------------------------------------------------------- 1 | # 学習 2 | 3 | ここでは、**FastAPI** を学習するための入門セクションとチュートリアルを紹介します。 4 | 5 | これは、FastAPIを学習するにあたっての**書籍**や**コース**であり、**公式**かつ推奨される方法とみなすことができます 😎 6 | -------------------------------------------------------------------------------- /docs/ja/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/ko/docs/about/index.md: -------------------------------------------------------------------------------- 1 | # 소개 2 | 3 | FastAPI에 대한 디자인, 영감 등에 대해 🤓 4 | -------------------------------------------------------------------------------- /docs/ko/docs/advanced/testing-events.md: -------------------------------------------------------------------------------- 1 | # 이벤트 테스트: 시작 - 종료 2 | 3 | 테스트에서 이벤트 핸들러(`startup` 및 `shutdown`)를 실행해야 하는 경우, `with` 문과 함께 `TestClient`를 사용할 수 있습니다. 4 | 5 | {* ../../docs_src/app_testing/tutorial003.py hl[9:12,20:24] *} 6 | -------------------------------------------------------------------------------- /docs/ko/docs/learn/index.md: -------------------------------------------------------------------------------- 1 | # 배우기 2 | 3 | 여기 **FastAPI**를 배우기 위한 입문 자료와 자습서가 있습니다. 4 | 5 | 여러분은 FastAPI를 배우기 위해 **책**, **강의**, **공식 자료** 그리고 추천받은 방법을 고려할 수 있습니다. 😎 6 | -------------------------------------------------------------------------------- /docs/ko/docs/resources/index.md: -------------------------------------------------------------------------------- 1 | # 리소스 2 | 3 | 추가 리소스, 외부 링크, 기사 등. ✈️ 4 | -------------------------------------------------------------------------------- /docs/ko/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/missing-translation.md: -------------------------------------------------------------------------------- 1 | /// warning 2 | 3 | The current page still doesn't have a translation for this language. 4 | 5 | But you can help translating it: [Contributing](https://fastapi.tiangolo.com/contributing/){.internal-link target=_blank}. 6 | 7 | /// 8 | -------------------------------------------------------------------------------- /docs/nl/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/pl/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/pt/docs/about/index.md: -------------------------------------------------------------------------------- 1 | # Sobre 2 | 3 | Sobre o FastAPI, seus padrões, inspirações e muito mais. 🤓 4 | -------------------------------------------------------------------------------- /docs/pt/docs/advanced/testing-events.md: -------------------------------------------------------------------------------- 1 | # Testando Eventos: inicialização - encerramento 2 | 3 | Quando você precisa que os seus manipuladores de eventos (`startup` e `shutdown`) sejam executados em seus testes, você pode utilizar o `TestClient` usando a instrução `with`: 4 | 5 | {* ../../docs_src/app_testing/tutorial003.py hl[9:12,20:24] *} 6 | -------------------------------------------------------------------------------- /docs/pt/docs/deployment/index.md: -------------------------------------------------------------------------------- 1 | # Implantação 2 | 3 | A implantação de uma aplicação **FastAPI** é relativamente simples. 4 | 5 | Existem várias maneiras para fazer isso, dependendo do seu caso específico e das ferramentas que você utiliza. 6 | 7 | Você verá mais detalhes para se ter em mente e algumas das técnicas para a implantação nas próximas seções. 8 | -------------------------------------------------------------------------------- /docs/pt/docs/learn/index.md: -------------------------------------------------------------------------------- 1 | # Aprender 2 | 3 | Nesta parte da documentação encontramos as seções introdutórias e os tutoriais para aprendermos como usar o **FastAPI**. 4 | 5 | Nós poderíamos considerar isto um **livro**, **curso**, a maneira **oficial** e recomendada de aprender o FastAPI. 😎 6 | -------------------------------------------------------------------------------- /docs/pt/docs/resources/index.md: -------------------------------------------------------------------------------- 1 | # Recursos 2 | 3 | Material complementar, links externos, artigos e muito mais. ✈️ 4 | -------------------------------------------------------------------------------- /docs/pt/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/ru/docs/about/index.md: -------------------------------------------------------------------------------- 1 | # О проекте 2 | 3 | FastAPI: внутреннее устройство, повлиявшие технологии и всё такое прочее. 🤓 4 | -------------------------------------------------------------------------------- /docs/ru/docs/learn/index.md: -------------------------------------------------------------------------------- 1 | # Обучение 2 | 3 | Здесь представлены вводные разделы и учебные пособия для изучения **FastAPI**. 4 | 5 | Вы можете считать это **книгой**, **курсом**, **официальным** и рекомендуемым способом изучения FastAPI. 😎 6 | -------------------------------------------------------------------------------- /docs/ru/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/tr/docs/about/index.md: -------------------------------------------------------------------------------- 1 | # Hakkında 2 | 3 | FastAPI, tasarımı, ilham kaynağı ve daha fazlası hakkında. 🤓 4 | -------------------------------------------------------------------------------- /docs/tr/docs/learn/index.md: -------------------------------------------------------------------------------- 1 | # Öğren 2 | 3 | **FastAPI** öğrenmek için giriş bölümleri ve öğreticiler burada yer alıyor. 4 | 5 | Burayı, bir **kitap**, bir **kurs**, ve FastAPI öğrenmenin **resmi** ve önerilen yolu olarak düşünülebilirsiniz. 😎 6 | -------------------------------------------------------------------------------- /docs/tr/docs/resources/index.md: -------------------------------------------------------------------------------- 1 | # Kaynaklar 2 | 3 | Ek kaynaklar, dış bağlantılar, makaleler ve daha fazlası. ✈️ 4 | -------------------------------------------------------------------------------- /docs/tr/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/uk/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/ur/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/vi/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/yo/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/zh-hant/docs/about/index.md: -------------------------------------------------------------------------------- 1 | # 關於 FastAPI 2 | 3 | 關於 FastAPI、其設計、靈感來源等更多資訊。 🤓 4 | -------------------------------------------------------------------------------- /docs/zh-hant/docs/how-to/index.md: -------------------------------------------------------------------------------- 1 | # 使用指南 - 範例集 2 | 3 | 在這裡,你將會看到**不同主題**的範例或「如何使用」的指南。 4 | 5 | 大多數這些想法都是**獨立**的,在大多數情況下,你只需要研究那些直接適用於**你的專案**的東西。 6 | 7 | 如果有些東西看起來很有趣且對你的專案很有用的話再去讀它,否則你可能可以跳過它們。 8 | 9 | /// tip 10 | 11 | 如果你想要以結構化的方式**學習 FastAPI**(推薦),請前往[教學 - 使用者指南](../tutorial/index.md){.internal-link target=_blank}逐章閱讀。 12 | 13 | /// 14 | -------------------------------------------------------------------------------- /docs/zh-hant/docs/learn/index.md: -------------------------------------------------------------------------------- 1 | # 學習 2 | 3 | 以下是學習 FastAPI 的入門介紹和教學。 4 | 5 | 你可以將其視為一本**書籍**或一門**課程**,這是**官方**認可並推薦的 FastAPI 學習方式。 😎 6 | -------------------------------------------------------------------------------- /docs/zh-hant/docs/resources/index.md: -------------------------------------------------------------------------------- 1 | # 資源 2 | 3 | 額外的資源、外部連結、文章等。 ✈️ 4 | -------------------------------------------------------------------------------- /docs/zh-hant/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs/zh/docs/advanced/security/index.md: -------------------------------------------------------------------------------- 1 | # 高级安全 2 | 3 | ## 附加特性 4 | 5 | 除 [教程 - 用户指南: 安全性](../../tutorial/security/index.md){.internal-link target=_blank} 中涵盖的功能之外,还有一些额外的功能来处理安全性. 6 | 7 | /// tip | 小贴士 8 | 9 | 接下来的章节 **并不一定是 "高级的"**. 10 | 11 | 而且对于你的使用场景来说,解决方案很可能就在其中。 12 | 13 | /// 14 | 15 | ## 先阅读教程 16 | 17 | 接下来的部分假设你已经阅读了主要的 [教程 - 用户指南: 安全性](../../tutorial/security/index.md){.internal-link target=_blank}. 18 | 19 | 它们都基于相同的概念,但支持一些额外的功能. 20 | -------------------------------------------------------------------------------- /docs/zh/docs/advanced/testing-events.md: -------------------------------------------------------------------------------- 1 | # 测试事件:启动 - 关闭 2 | 3 | 使用 `TestClient` 和 `with` 语句,在测试中运行事件处理器(`startup` 与 `shutdown`)。 4 | 5 | {* ../../docs_src/app_testing/tutorial003.py hl[9:12,20:24] *} 6 | -------------------------------------------------------------------------------- /docs/zh/docs/advanced/testing-websockets.md: -------------------------------------------------------------------------------- 1 | # 测试 WebSockets 2 | 3 | 测试 WebSockets 也使用 `TestClient`。 4 | 5 | 为此,要在 `with` 语句中使用 `TestClient` 连接 WebSocket。 6 | 7 | {* ../../docs_src/app_testing/tutorial002.py hl[27:31] *} 8 | 9 | /// note | 笔记 10 | 11 | 更多细节详见 Starlette 官档 - 测试 WebSockets。 12 | 13 | /// 14 | -------------------------------------------------------------------------------- /docs/zh/docs/how-to/index.md: -------------------------------------------------------------------------------- 1 | # 如何操作 - 诀窍 2 | 3 | 在这里,你将看到关于**多个主题**的不同诀窍或“如何操作”指南。 4 | 5 | 这些方法多数是**相互独立**的,在大多数情况下,你只需在这些内容适用于**你的项目**时才需要学习它们。 6 | 7 | 如果某些内容看起来对你的项目有用,请继续查阅,否则请直接跳过它们。 8 | 9 | /// tip | 小技巧 10 | 11 | 如果你想以系统的方式**学习 FastAPI**(推荐),请阅读 [教程 - 用户指南](../tutorial/index.md){.internal-link target=_blank} 的每一章节。 12 | 13 | /// 14 | -------------------------------------------------------------------------------- /docs/zh/docs/learn/index.md: -------------------------------------------------------------------------------- 1 | # 学习 2 | 3 | 以下是学习 **FastAPI** 的介绍部分和教程。 4 | 5 | 您可以认为这是一本 **书**,一门 **课程**,是 **官方** 且推荐的学习FastAPI的方法。😎 6 | -------------------------------------------------------------------------------- /docs/zh/mkdocs.yml: -------------------------------------------------------------------------------- 1 | INHERIT: ../en/mkdocs.yml 2 | -------------------------------------------------------------------------------- /docs_src/advanced_middleware/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.middleware.httpsredirect import HTTPSRedirectMiddleware 3 | 4 | app = FastAPI() 5 | 6 | app.add_middleware(HTTPSRedirectMiddleware) 7 | 8 | 9 | @app.get("/") 10 | async def main(): 11 | return {"message": "Hello World"} 12 | -------------------------------------------------------------------------------- /docs_src/advanced_middleware/tutorial002.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.middleware.trustedhost import TrustedHostMiddleware 3 | 4 | app = FastAPI() 5 | 6 | app.add_middleware( 7 | TrustedHostMiddleware, allowed_hosts=["example.com", "*.example.com"] 8 | ) 9 | 10 | 11 | @app.get("/") 12 | async def main(): 13 | return {"message": "Hello World"} 14 | -------------------------------------------------------------------------------- /docs_src/advanced_middleware/tutorial003.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.middleware.gzip import GZipMiddleware 3 | 4 | app = FastAPI() 5 | 6 | app.add_middleware(GZipMiddleware, minimum_size=1000, compresslevel=5) 7 | 8 | 9 | @app.get("/") 10 | async def main(): 11 | return "somebigcontent" 12 | -------------------------------------------------------------------------------- /docs_src/app_testing/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/app_testing/__init__.py -------------------------------------------------------------------------------- /docs_src/app_testing/app_b/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/app_testing/app_b/__init__.py -------------------------------------------------------------------------------- /docs_src/app_testing/app_b_an/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/app_testing/app_b_an/__init__.py -------------------------------------------------------------------------------- /docs_src/app_testing/app_b_an_py310/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/app_testing/app_b_an_py310/__init__.py -------------------------------------------------------------------------------- /docs_src/app_testing/app_b_an_py39/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/app_testing/app_b_an_py39/__init__.py -------------------------------------------------------------------------------- /docs_src/app_testing/app_b_py310/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/app_testing/app_b_py310/__init__.py -------------------------------------------------------------------------------- /docs_src/app_testing/main.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/") 7 | async def read_main(): 8 | return {"msg": "Hello World"} 9 | -------------------------------------------------------------------------------- /docs_src/app_testing/test_main.py: -------------------------------------------------------------------------------- 1 | from fastapi.testclient import TestClient 2 | 3 | from .main import app 4 | 5 | client = TestClient(app) 6 | 7 | 8 | def test_read_main(): 9 | response = client.get("/") 10 | assert response.status_code == 200 11 | assert response.json() == {"msg": "Hello World"} 12 | -------------------------------------------------------------------------------- /docs_src/app_testing/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.testclient import TestClient 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/") 8 | async def read_main(): 9 | return {"msg": "Hello World"} 10 | 11 | 12 | client = TestClient(app) 13 | 14 | 15 | def test_read_main(): 16 | response = client.get("/") 17 | assert response.status_code == 200 18 | assert response.json() == {"msg": "Hello World"} 19 | -------------------------------------------------------------------------------- /docs_src/async_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/async_tests/__init__.py -------------------------------------------------------------------------------- /docs_src/async_tests/main.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/") 7 | async def root(): 8 | return {"message": "Tomato"} 9 | -------------------------------------------------------------------------------- /docs_src/async_tests/test_main.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from httpx import ASGITransport, AsyncClient 3 | 4 | from .main import app 5 | 6 | 7 | @pytest.mark.anyio 8 | async def test_root(): 9 | async with AsyncClient( 10 | transport=ASGITransport(app=app), base_url="http://test" 11 | ) as ac: 12 | response = await ac.get("/") 13 | assert response.status_code == 200 14 | assert response.json() == {"message": "Tomato"} 15 | -------------------------------------------------------------------------------- /docs_src/behind_a_proxy/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Request 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/app") 7 | def read_main(request: Request): 8 | return {"message": "Hello World", "root_path": request.scope.get("root_path")} 9 | -------------------------------------------------------------------------------- /docs_src/behind_a_proxy/tutorial002.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Request 2 | 3 | app = FastAPI(root_path="/api/v1") 4 | 5 | 6 | @app.get("/app") 7 | def read_main(request: Request): 8 | return {"message": "Hello World", "root_path": request.scope.get("root_path")} 9 | -------------------------------------------------------------------------------- /docs_src/bigger_applications/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/bigger_applications/__init__.py -------------------------------------------------------------------------------- /docs_src/bigger_applications/app/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/bigger_applications/app/__init__.py -------------------------------------------------------------------------------- /docs_src/bigger_applications/app/dependencies.py: -------------------------------------------------------------------------------- 1 | from fastapi import Header, HTTPException 2 | 3 | 4 | async def get_token_header(x_token: str = Header()): 5 | if x_token != "fake-super-secret-token": 6 | raise HTTPException(status_code=400, detail="X-Token header invalid") 7 | 8 | 9 | async def get_query_token(token: str): 10 | if token != "jessica": 11 | raise HTTPException(status_code=400, detail="No Jessica token provided") 12 | -------------------------------------------------------------------------------- /docs_src/bigger_applications/app/internal/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/bigger_applications/app/internal/__init__.py -------------------------------------------------------------------------------- /docs_src/bigger_applications/app/internal/admin.py: -------------------------------------------------------------------------------- 1 | from fastapi import APIRouter 2 | 3 | router = APIRouter() 4 | 5 | 6 | @router.post("/") 7 | async def update_admin(): 8 | return {"message": "Admin getting schwifty"} 9 | -------------------------------------------------------------------------------- /docs_src/bigger_applications/app/routers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/bigger_applications/app/routers/__init__.py -------------------------------------------------------------------------------- /docs_src/bigger_applications/app_an/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/bigger_applications/app_an/__init__.py -------------------------------------------------------------------------------- /docs_src/bigger_applications/app_an/internal/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/bigger_applications/app_an/internal/__init__.py -------------------------------------------------------------------------------- /docs_src/bigger_applications/app_an/internal/admin.py: -------------------------------------------------------------------------------- 1 | from fastapi import APIRouter 2 | 3 | router = APIRouter() 4 | 5 | 6 | @router.post("/") 7 | async def update_admin(): 8 | return {"message": "Admin getting schwifty"} 9 | -------------------------------------------------------------------------------- /docs_src/bigger_applications/app_an/routers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/bigger_applications/app_an/routers/__init__.py -------------------------------------------------------------------------------- /docs_src/bigger_applications/app_an_py39/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/bigger_applications/app_an_py39/__init__.py -------------------------------------------------------------------------------- /docs_src/bigger_applications/app_an_py39/internal/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/bigger_applications/app_an_py39/internal/__init__.py -------------------------------------------------------------------------------- /docs_src/bigger_applications/app_an_py39/internal/admin.py: -------------------------------------------------------------------------------- 1 | from fastapi import APIRouter 2 | 3 | router = APIRouter() 4 | 5 | 6 | @router.post("/") 7 | async def update_admin(): 8 | return {"message": "Admin getting schwifty"} 9 | -------------------------------------------------------------------------------- /docs_src/bigger_applications/app_an_py39/routers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/bigger_applications/app_an_py39/routers/__init__.py -------------------------------------------------------------------------------- /docs_src/body/tutorial001.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI 4 | from pydantic import BaseModel 5 | 6 | 7 | class Item(BaseModel): 8 | name: str 9 | description: Union[str, None] = None 10 | price: float 11 | tax: Union[float, None] = None 12 | 13 | 14 | app = FastAPI() 15 | 16 | 17 | @app.post("/items/") 18 | async def create_item(item: Item): 19 | return item 20 | -------------------------------------------------------------------------------- /docs_src/body/tutorial001_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from pydantic import BaseModel 3 | 4 | 5 | class Item(BaseModel): 6 | name: str 7 | description: str | None = None 8 | price: float 9 | tax: float | None = None 10 | 11 | 12 | app = FastAPI() 13 | 14 | 15 | @app.post("/items/") 16 | async def create_item(item: Item): 17 | return item 18 | -------------------------------------------------------------------------------- /docs_src/body/tutorial003_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from pydantic import BaseModel 3 | 4 | 5 | class Item(BaseModel): 6 | name: str 7 | description: str | None = None 8 | price: float 9 | tax: float | None = None 10 | 11 | 12 | app = FastAPI() 13 | 14 | 15 | @app.put("/items/{item_id}") 16 | async def update_item(item_id: int, item: Item): 17 | return {"item_id": item_id, **item.dict()} 18 | -------------------------------------------------------------------------------- /docs_src/body_nested_models/tutorial008.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from fastapi import FastAPI 4 | from pydantic import BaseModel, HttpUrl 5 | 6 | app = FastAPI() 7 | 8 | 9 | class Image(BaseModel): 10 | url: HttpUrl 11 | name: str 12 | 13 | 14 | @app.post("/images/multiple/") 15 | async def create_multiple_images(images: List[Image]): 16 | return images 17 | -------------------------------------------------------------------------------- /docs_src/body_nested_models/tutorial008_py39.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from pydantic import BaseModel, HttpUrl 3 | 4 | app = FastAPI() 5 | 6 | 7 | class Image(BaseModel): 8 | url: HttpUrl 9 | name: str 10 | 11 | 12 | @app.post("/images/multiple/") 13 | async def create_multiple_images(images: list[Image]): 14 | return images 15 | -------------------------------------------------------------------------------- /docs_src/body_nested_models/tutorial009.py: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | from fastapi import FastAPI 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.post("/index-weights/") 9 | async def create_index_weights(weights: Dict[int, float]): 10 | return weights 11 | -------------------------------------------------------------------------------- /docs_src/body_nested_models/tutorial009_py39.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.post("/index-weights/") 7 | async def create_index_weights(weights: dict[int, float]): 8 | return weights 9 | -------------------------------------------------------------------------------- /docs_src/conditional_openapi/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from pydantic_settings import BaseSettings 3 | 4 | 5 | class Settings(BaseSettings): 6 | openapi_url: str = "/openapi.json" 7 | 8 | 9 | settings = Settings() 10 | 11 | app = FastAPI(openapi_url=settings.openapi_url) 12 | 13 | 14 | @app.get("/") 15 | def root(): 16 | return {"message": "Hello World"} 17 | -------------------------------------------------------------------------------- /docs_src/configure_swagger_ui/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI(swagger_ui_parameters={"syntaxHighlight": False}) 4 | 5 | 6 | @app.get("/users/{username}") 7 | async def read_user(username: str): 8 | return {"message": f"Hello {username}"} 9 | -------------------------------------------------------------------------------- /docs_src/configure_swagger_ui/tutorial002.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI(swagger_ui_parameters={"syntaxHighlight.theme": "obsidian"}) 4 | 5 | 6 | @app.get("/users/{username}") 7 | async def read_user(username: str): 8 | return {"message": f"Hello {username}"} 9 | -------------------------------------------------------------------------------- /docs_src/configure_swagger_ui/tutorial003.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI(swagger_ui_parameters={"deepLinking": False}) 4 | 5 | 6 | @app.get("/users/{username}") 7 | async def read_user(username: str): 8 | return {"message": f"Hello {username}"} 9 | -------------------------------------------------------------------------------- /docs_src/cookie_param_models/tutorial001.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import Cookie, FastAPI 4 | from pydantic import BaseModel 5 | 6 | app = FastAPI() 7 | 8 | 9 | class Cookies(BaseModel): 10 | session_id: str 11 | fatebook_tracker: Union[str, None] = None 12 | googall_tracker: Union[str, None] = None 13 | 14 | 15 | @app.get("/items/") 16 | async def read_items(cookies: Cookies = Cookie()): 17 | return cookies 18 | -------------------------------------------------------------------------------- /docs_src/cookie_param_models/tutorial001_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import Cookie, FastAPI 2 | from pydantic import BaseModel 3 | 4 | app = FastAPI() 5 | 6 | 7 | class Cookies(BaseModel): 8 | session_id: str 9 | fatebook_tracker: str | None = None 10 | googall_tracker: str | None = None 11 | 12 | 13 | @app.get("/items/") 14 | async def read_items(cookies: Cookies = Cookie()): 15 | return cookies 16 | -------------------------------------------------------------------------------- /docs_src/cookie_params/tutorial001.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import Cookie, FastAPI 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(ads_id: Union[str, None] = Cookie(default=None)): 10 | return {"ads_id": ads_id} 11 | -------------------------------------------------------------------------------- /docs_src/cookie_params/tutorial001_an.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import Cookie, FastAPI 4 | from typing_extensions import Annotated 5 | 6 | app = FastAPI() 7 | 8 | 9 | @app.get("/items/") 10 | async def read_items(ads_id: Annotated[Union[str, None], Cookie()] = None): 11 | return {"ads_id": ads_id} 12 | -------------------------------------------------------------------------------- /docs_src/cookie_params/tutorial001_an_py310.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import Cookie, FastAPI 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(ads_id: Annotated[str | None, Cookie()] = None): 10 | return {"ads_id": ads_id} 11 | -------------------------------------------------------------------------------- /docs_src/cookie_params/tutorial001_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated, Union 2 | 3 | from fastapi import Cookie, FastAPI 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(ads_id: Annotated[Union[str, None], Cookie()] = None): 10 | return {"ads_id": ads_id} 11 | -------------------------------------------------------------------------------- /docs_src/cookie_params/tutorial001_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import Cookie, FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(ads_id: str | None = Cookie(default=None)): 8 | return {"ads_id": ads_id} 9 | -------------------------------------------------------------------------------- /docs_src/custom_response/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.responses import UJSONResponse 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/items/", response_class=UJSONResponse) 8 | async def read_items(): 9 | return [{"item_id": "Foo"}] 10 | -------------------------------------------------------------------------------- /docs_src/custom_response/tutorial001b.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.responses import ORJSONResponse 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/items/", response_class=ORJSONResponse) 8 | async def read_items(): 9 | return ORJSONResponse([{"item_id": "Foo"}]) 10 | -------------------------------------------------------------------------------- /docs_src/custom_response/tutorial005.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.responses import PlainTextResponse 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/", response_class=PlainTextResponse) 8 | async def main(): 9 | return "Hello World" 10 | -------------------------------------------------------------------------------- /docs_src/custom_response/tutorial006.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.responses import RedirectResponse 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/typer") 8 | async def redirect_typer(): 9 | return RedirectResponse("https://typer.tiangolo.com") 10 | -------------------------------------------------------------------------------- /docs_src/custom_response/tutorial006b.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.responses import RedirectResponse 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/fastapi", response_class=RedirectResponse) 8 | async def redirect_fastapi(): 9 | return "https://fastapi.tiangolo.com" 10 | -------------------------------------------------------------------------------- /docs_src/custom_response/tutorial006c.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.responses import RedirectResponse 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/pydantic", response_class=RedirectResponse, status_code=302) 8 | async def redirect_pydantic(): 9 | return "https://docs.pydantic.dev/" 10 | -------------------------------------------------------------------------------- /docs_src/custom_response/tutorial007.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.responses import StreamingResponse 3 | 4 | app = FastAPI() 5 | 6 | 7 | async def fake_video_streamer(): 8 | for i in range(10): 9 | yield b"some fake video bytes" 10 | 11 | 12 | @app.get("/") 13 | async def main(): 14 | return StreamingResponse(fake_video_streamer()) 15 | -------------------------------------------------------------------------------- /docs_src/custom_response/tutorial008.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.responses import StreamingResponse 3 | 4 | some_file_path = "large-video-file.mp4" 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/") 9 | def main(): 10 | def iterfile(): # (1) 11 | with open(some_file_path, mode="rb") as file_like: # (2) 12 | yield from file_like # (3) 13 | 14 | return StreamingResponse(iterfile(), media_type="video/mp4") 15 | -------------------------------------------------------------------------------- /docs_src/custom_response/tutorial009.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.responses import FileResponse 3 | 4 | some_file_path = "large-video-file.mp4" 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/") 9 | async def main(): 10 | return FileResponse(some_file_path) 11 | -------------------------------------------------------------------------------- /docs_src/custom_response/tutorial009b.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.responses import FileResponse 3 | 4 | some_file_path = "large-video-file.mp4" 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/", response_class=FileResponse) 9 | async def main(): 10 | return some_file_path 11 | -------------------------------------------------------------------------------- /docs_src/custom_response/tutorial010.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.responses import ORJSONResponse 3 | 4 | app = FastAPI(default_response_class=ORJSONResponse) 5 | 6 | 7 | @app.get("/items/") 8 | async def read_items(): 9 | return [{"item_id": "Foo"}] 10 | -------------------------------------------------------------------------------- /docs_src/dataclasses/tutorial001.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from typing import Union 3 | 4 | from fastapi import FastAPI 5 | 6 | 7 | @dataclass 8 | class Item: 9 | name: str 10 | price: float 11 | description: Union[str, None] = None 12 | tax: Union[float, None] = None 13 | 14 | 15 | app = FastAPI() 16 | 17 | 18 | @app.post("/items/") 19 | async def create_item(item: Item): 20 | return item 21 | -------------------------------------------------------------------------------- /docs_src/debugging/tutorial001.py: -------------------------------------------------------------------------------- 1 | import uvicorn 2 | from fastapi import FastAPI 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/") 8 | def root(): 9 | a = "a" 10 | b = "b" + a 11 | return {"hello world": b} 12 | 13 | 14 | if __name__ == "__main__": 15 | uvicorn.run(app, host="0.0.0.0", port=8000) 16 | -------------------------------------------------------------------------------- /docs_src/dependencies/tutorial007.py: -------------------------------------------------------------------------------- 1 | async def get_db(): 2 | db = DBSession() 3 | try: 4 | yield db 5 | finally: 6 | db.close() 7 | -------------------------------------------------------------------------------- /docs_src/dependencies/tutorial010.py: -------------------------------------------------------------------------------- 1 | class MySuperContextManager: 2 | def __init__(self): 3 | self.db = DBSession() 4 | 5 | def __enter__(self): 6 | return self.db 7 | 8 | def __exit__(self, exc_type, exc_value, traceback): 9 | self.db.close() 10 | 11 | 12 | async def get_db(): 13 | with MySuperContextManager() as db: 14 | yield db 15 | -------------------------------------------------------------------------------- /docs_src/events/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | items = {} 6 | 7 | 8 | @app.on_event("startup") 9 | async def startup_event(): 10 | items["foo"] = {"name": "Fighters"} 11 | items["bar"] = {"name": "Tenders"} 12 | 13 | 14 | @app.get("/items/{item_id}") 15 | async def read_items(item_id: str): 16 | return items[item_id] 17 | -------------------------------------------------------------------------------- /docs_src/events/tutorial002.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.on_event("shutdown") 7 | def shutdown_event(): 8 | with open("log.txt", mode="a") as log: 9 | log.write("Application shutdown") 10 | 11 | 12 | @app.get("/items/") 13 | async def read_items(): 14 | return [{"name": "Foo"}] 15 | -------------------------------------------------------------------------------- /docs_src/extra_models/tutorial005.py: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | from fastapi import FastAPI 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/keyword-weights/", response_model=Dict[str, float]) 9 | async def read_keyword_weights(): 10 | return {"foo": 2.3, "bar": 3.4} 11 | -------------------------------------------------------------------------------- /docs_src/extra_models/tutorial005_py39.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/keyword-weights/", response_model=dict[str, float]) 7 | async def read_keyword_weights(): 8 | return {"foo": 2.3, "bar": 3.4} 9 | -------------------------------------------------------------------------------- /docs_src/first_steps/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/") 7 | async def root(): 8 | return {"message": "Hello World"} 9 | -------------------------------------------------------------------------------- /docs_src/first_steps/tutorial002.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | my_awesome_api = FastAPI() 4 | 5 | 6 | @my_awesome_api.get("/") 7 | async def root(): 8 | return {"message": "Hello World"} 9 | -------------------------------------------------------------------------------- /docs_src/first_steps/tutorial003.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/") 7 | def root(): 8 | return {"message": "Hello World"} 9 | -------------------------------------------------------------------------------- /docs_src/handling_errors/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, HTTPException 2 | 3 | app = FastAPI() 4 | 5 | items = {"foo": "The Foo Wrestlers"} 6 | 7 | 8 | @app.get("/items/{item_id}") 9 | async def read_item(item_id: str): 10 | if item_id not in items: 11 | raise HTTPException(status_code=404, detail="Item not found") 12 | return {"item": items[item_id]} 13 | -------------------------------------------------------------------------------- /docs_src/header_params/tutorial001.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI, Header 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(user_agent: Union[str, None] = Header(default=None)): 10 | return {"User-Agent": user_agent} 11 | -------------------------------------------------------------------------------- /docs_src/header_params/tutorial001_an.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI, Header 4 | from typing_extensions import Annotated 5 | 6 | app = FastAPI() 7 | 8 | 9 | @app.get("/items/") 10 | async def read_items(user_agent: Annotated[Union[str, None], Header()] = None): 11 | return {"User-Agent": user_agent} 12 | -------------------------------------------------------------------------------- /docs_src/header_params/tutorial001_an_py310.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Header 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(user_agent: Annotated[str | None, Header()] = None): 10 | return {"User-Agent": user_agent} 11 | -------------------------------------------------------------------------------- /docs_src/header_params/tutorial001_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated, Union 2 | 3 | from fastapi import FastAPI, Header 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(user_agent: Annotated[Union[str, None], Header()] = None): 10 | return {"User-Agent": user_agent} 11 | -------------------------------------------------------------------------------- /docs_src/header_params/tutorial001_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Header 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(user_agent: str | None = Header(default=None)): 8 | return {"User-Agent": user_agent} 9 | -------------------------------------------------------------------------------- /docs_src/header_params/tutorial002.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI, Header 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items( 10 | strange_header: Union[str, None] = Header(default=None, convert_underscores=False), 11 | ): 12 | return {"strange_header": strange_header} 13 | -------------------------------------------------------------------------------- /docs_src/header_params/tutorial002_an.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI, Header 4 | from typing_extensions import Annotated 5 | 6 | app = FastAPI() 7 | 8 | 9 | @app.get("/items/") 10 | async def read_items( 11 | strange_header: Annotated[ 12 | Union[str, None], Header(convert_underscores=False) 13 | ] = None, 14 | ): 15 | return {"strange_header": strange_header} 16 | -------------------------------------------------------------------------------- /docs_src/header_params/tutorial002_an_py310.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Header 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items( 10 | strange_header: Annotated[str | None, Header(convert_underscores=False)] = None, 11 | ): 12 | return {"strange_header": strange_header} 13 | -------------------------------------------------------------------------------- /docs_src/header_params/tutorial002_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated, Union 2 | 3 | from fastapi import FastAPI, Header 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items( 10 | strange_header: Annotated[ 11 | Union[str, None], Header(convert_underscores=False) 12 | ] = None, 13 | ): 14 | return {"strange_header": strange_header} 15 | -------------------------------------------------------------------------------- /docs_src/header_params/tutorial002_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Header 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items( 8 | strange_header: str | None = Header(default=None, convert_underscores=False), 9 | ): 10 | return {"strange_header": strange_header} 11 | -------------------------------------------------------------------------------- /docs_src/header_params/tutorial003.py: -------------------------------------------------------------------------------- 1 | from typing import List, Union 2 | 3 | from fastapi import FastAPI, Header 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(x_token: Union[List[str], None] = Header(default=None)): 10 | return {"X-Token values": x_token} 11 | -------------------------------------------------------------------------------- /docs_src/header_params/tutorial003_an.py: -------------------------------------------------------------------------------- 1 | from typing import List, Union 2 | 3 | from fastapi import FastAPI, Header 4 | from typing_extensions import Annotated 5 | 6 | app = FastAPI() 7 | 8 | 9 | @app.get("/items/") 10 | async def read_items(x_token: Annotated[Union[List[str], None], Header()] = None): 11 | return {"X-Token values": x_token} 12 | -------------------------------------------------------------------------------- /docs_src/header_params/tutorial003_an_py310.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Header 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(x_token: Annotated[list[str] | None, Header()] = None): 10 | return {"X-Token values": x_token} 11 | -------------------------------------------------------------------------------- /docs_src/header_params/tutorial003_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated, List, Union 2 | 3 | from fastapi import FastAPI, Header 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(x_token: Annotated[Union[List[str], None], Header()] = None): 10 | return {"X-Token values": x_token} 11 | -------------------------------------------------------------------------------- /docs_src/header_params/tutorial003_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Header 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(x_token: list[str] | None = Header(default=None)): 8 | return {"X-Token values": x_token} 9 | -------------------------------------------------------------------------------- /docs_src/header_params/tutorial003_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI, Header 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(x_token: Union[list[str], None] = Header(default=None)): 10 | return {"X-Token values": x_token} 11 | -------------------------------------------------------------------------------- /docs_src/metadata/tutorial002.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI(openapi_url="/api/v1/openapi.json") 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(): 8 | return [{"name": "Foo"}] 9 | -------------------------------------------------------------------------------- /docs_src/metadata/tutorial003.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI(docs_url="/documentation", redoc_url=None) 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(): 8 | return [{"name": "Foo"}] 9 | -------------------------------------------------------------------------------- /docs_src/middleware/tutorial001.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | from fastapi import FastAPI, Request 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.middleware("http") 9 | async def add_process_time_header(request: Request, call_next): 10 | start_time = time.perf_counter() 11 | response = await call_next(request) 12 | process_time = time.perf_counter() - start_time 13 | response.headers["X-Process-Time"] = str(process_time) 14 | return response 15 | -------------------------------------------------------------------------------- /docs_src/path_operation_advanced_configuration/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/", operation_id="some_specific_id_you_define") 7 | async def read_items(): 8 | return [{"item_id": "Foo"}] 9 | -------------------------------------------------------------------------------- /docs_src/path_operation_advanced_configuration/tutorial003.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/", include_in_schema=False) 7 | async def read_items(): 8 | return [{"item_id": "Foo"}] 9 | -------------------------------------------------------------------------------- /docs_src/path_operation_advanced_configuration/tutorial005.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/", openapi_extra={"x-aperture-labs-portal": "blue"}) 7 | async def read_items(): 8 | return [{"item_id": "portal-gun"}] 9 | -------------------------------------------------------------------------------- /docs_src/path_params/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/{item_id}") 7 | async def read_item(item_id): 8 | return {"item_id": item_id} 9 | -------------------------------------------------------------------------------- /docs_src/path_params/tutorial002.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/{item_id}") 7 | async def read_item(item_id: int): 8 | return {"item_id": item_id} 9 | -------------------------------------------------------------------------------- /docs_src/path_params/tutorial003.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/users/me") 7 | async def read_user_me(): 8 | return {"user_id": "the current user"} 9 | 10 | 11 | @app.get("/users/{user_id}") 12 | async def read_user(user_id: str): 13 | return {"user_id": user_id} 14 | -------------------------------------------------------------------------------- /docs_src/path_params/tutorial003b.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/users") 7 | async def read_users(): 8 | return ["Rick", "Morty"] 9 | 10 | 11 | @app.get("/users") 12 | async def read_users2(): 13 | return ["Bean", "Elfo"] 14 | -------------------------------------------------------------------------------- /docs_src/path_params/tutorial004.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/files/{file_path:path}") 7 | async def read_file(file_path: str): 8 | return {"file_path": file_path} 9 | -------------------------------------------------------------------------------- /docs_src/path_params_numeric_validations/tutorial001_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Path, Query 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/{item_id}") 7 | async def read_items( 8 | item_id: int = Path(title="The ID of the item to get"), 9 | q: str | None = Query(default=None, alias="item-query"), 10 | ): 11 | results = {"item_id": item_id} 12 | if q: 13 | results.update({"q": q}) 14 | return results 15 | -------------------------------------------------------------------------------- /docs_src/path_params_numeric_validations/tutorial002.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Path 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/{item_id}") 7 | async def read_items(q: str, item_id: int = Path(title="The ID of the item to get")): 8 | results = {"item_id": item_id} 9 | if q: 10 | results.update({"q": q}) 11 | return results 12 | -------------------------------------------------------------------------------- /docs_src/path_params_numeric_validations/tutorial002_an.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Path 2 | from typing_extensions import Annotated 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/items/{item_id}") 8 | async def read_items( 9 | q: str, item_id: Annotated[int, Path(title="The ID of the item to get")] 10 | ): 11 | results = {"item_id": item_id} 12 | if q: 13 | results.update({"q": q}) 14 | return results 15 | -------------------------------------------------------------------------------- /docs_src/path_params_numeric_validations/tutorial002_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Path 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/{item_id}") 9 | async def read_items( 10 | q: str, item_id: Annotated[int, Path(title="The ID of the item to get")] 11 | ): 12 | results = {"item_id": item_id} 13 | if q: 14 | results.update({"q": q}) 15 | return results 16 | -------------------------------------------------------------------------------- /docs_src/path_params_numeric_validations/tutorial003.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Path 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/{item_id}") 7 | async def read_items(*, item_id: int = Path(title="The ID of the item to get"), q: str): 8 | results = {"item_id": item_id} 9 | if q: 10 | results.update({"q": q}) 11 | return results 12 | -------------------------------------------------------------------------------- /docs_src/path_params_numeric_validations/tutorial003_an.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Path 2 | from typing_extensions import Annotated 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/items/{item_id}") 8 | async def read_items( 9 | item_id: Annotated[int, Path(title="The ID of the item to get")], q: str 10 | ): 11 | results = {"item_id": item_id} 12 | if q: 13 | results.update({"q": q}) 14 | return results 15 | -------------------------------------------------------------------------------- /docs_src/path_params_numeric_validations/tutorial003_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Path 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/{item_id}") 9 | async def read_items( 10 | item_id: Annotated[int, Path(title="The ID of the item to get")], q: str 11 | ): 12 | results = {"item_id": item_id} 13 | if q: 14 | results.update({"q": q}) 15 | return results 16 | -------------------------------------------------------------------------------- /docs_src/path_params_numeric_validations/tutorial004.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Path 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/{item_id}") 7 | async def read_items( 8 | *, item_id: int = Path(title="The ID of the item to get", ge=1), q: str 9 | ): 10 | results = {"item_id": item_id} 11 | if q: 12 | results.update({"q": q}) 13 | return results 14 | -------------------------------------------------------------------------------- /docs_src/path_params_numeric_validations/tutorial004_an.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Path 2 | from typing_extensions import Annotated 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/items/{item_id}") 8 | async def read_items( 9 | item_id: Annotated[int, Path(title="The ID of the item to get", ge=1)], q: str 10 | ): 11 | results = {"item_id": item_id} 12 | if q: 13 | results.update({"q": q}) 14 | return results 15 | -------------------------------------------------------------------------------- /docs_src/path_params_numeric_validations/tutorial004_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Path 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/{item_id}") 9 | async def read_items( 10 | item_id: Annotated[int, Path(title="The ID of the item to get", ge=1)], q: str 11 | ): 12 | results = {"item_id": item_id} 13 | if q: 14 | results.update({"q": q}) 15 | return results 16 | -------------------------------------------------------------------------------- /docs_src/path_params_numeric_validations/tutorial005.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Path 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/{item_id}") 7 | async def read_items( 8 | *, 9 | item_id: int = Path(title="The ID of the item to get", gt=0, le=1000), 10 | q: str, 11 | ): 12 | results = {"item_id": item_id} 13 | if q: 14 | results.update({"q": q}) 15 | return results 16 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial001.py: -------------------------------------------------------------------------------- 1 | def get_full_name(first_name, last_name): 2 | full_name = first_name.title() + " " + last_name.title() 3 | return full_name 4 | 5 | 6 | print(get_full_name("john", "doe")) 7 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial002.py: -------------------------------------------------------------------------------- 1 | def get_full_name(first_name: str, last_name: str): 2 | full_name = first_name.title() + " " + last_name.title() 3 | return full_name 4 | 5 | 6 | print(get_full_name("john", "doe")) 7 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial003.py: -------------------------------------------------------------------------------- 1 | def get_name_with_age(name: str, age: int): 2 | name_with_age = name + " is this old: " + age 3 | return name_with_age 4 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial004.py: -------------------------------------------------------------------------------- 1 | def get_name_with_age(name: str, age: int): 2 | name_with_age = name + " is this old: " + str(age) 3 | return name_with_age 4 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial005.py: -------------------------------------------------------------------------------- 1 | def get_items(item_a: str, item_b: int, item_c: float, item_d: bool, item_e: bytes): 2 | return item_a, item_b, item_c, item_d, item_d, item_e 3 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial006.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | 4 | def process_items(items: List[str]): 5 | for item in items: 6 | print(item) 7 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial006_py39.py: -------------------------------------------------------------------------------- 1 | def process_items(items: list[str]): 2 | for item in items: 3 | print(item) 4 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial007.py: -------------------------------------------------------------------------------- 1 | from typing import Set, Tuple 2 | 3 | 4 | def process_items(items_t: Tuple[int, int, str], items_s: Set[bytes]): 5 | return items_t, items_s 6 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial007_py39.py: -------------------------------------------------------------------------------- 1 | def process_items(items_t: tuple[int, int, str], items_s: set[bytes]): 2 | return items_t, items_s 3 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial008.py: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | 4 | def process_items(prices: Dict[str, float]): 5 | for item_name, item_price in prices.items(): 6 | print(item_name) 7 | print(item_price) 8 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial008_py39.py: -------------------------------------------------------------------------------- 1 | def process_items(prices: dict[str, float]): 2 | for item_name, item_price in prices.items(): 3 | print(item_name) 4 | print(item_price) 5 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial008b.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | 4 | def process_item(item: Union[int, str]): 5 | print(item) 6 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial008b_py310.py: -------------------------------------------------------------------------------- 1 | def process_item(item: int | str): 2 | print(item) 3 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial009.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | 4 | def say_hi(name: Optional[str] = None): 5 | if name is not None: 6 | print(f"Hey {name}!") 7 | else: 8 | print("Hello World") 9 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial009_py310.py: -------------------------------------------------------------------------------- 1 | def say_hi(name: str | None = None): 2 | if name is not None: 3 | print(f"Hey {name}!") 4 | else: 5 | print("Hello World") 6 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial009b.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | 4 | def say_hi(name: Union[str, None] = None): 5 | if name is not None: 6 | print(f"Hey {name}!") 7 | else: 8 | print("Hello World") 9 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial009c.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | 4 | def say_hi(name: Optional[str]): 5 | print(f"Hey {name}!") 6 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial009c_py310.py: -------------------------------------------------------------------------------- 1 | def say_hi(name: str | None): 2 | print(f"Hey {name}!") 3 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial010.py: -------------------------------------------------------------------------------- 1 | class Person: 2 | def __init__(self, name: str): 3 | self.name = name 4 | 5 | 6 | def get_person_name(one_person: Person): 7 | return one_person.name 8 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial012.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from pydantic import BaseModel 4 | 5 | 6 | class User(BaseModel): 7 | name: str 8 | age: Optional[int] 9 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial013.py: -------------------------------------------------------------------------------- 1 | from typing_extensions import Annotated 2 | 3 | 4 | def say_hello(name: Annotated[str, "this is just metadata"]) -> str: 5 | return f"Hello {name}" 6 | -------------------------------------------------------------------------------- /docs_src/python_types/tutorial013_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | 4 | def say_hello(name: Annotated[str, "this is just metadata"]) -> str: 5 | return f"Hello {name}" 6 | -------------------------------------------------------------------------------- /docs_src/query_params/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}] 6 | 7 | 8 | @app.get("/items/") 9 | async def read_item(skip: int = 0, limit: int = 10): 10 | return fake_items_db[skip : skip + limit] 11 | -------------------------------------------------------------------------------- /docs_src/query_params/tutorial002.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/{item_id}") 9 | async def read_item(item_id: str, q: Union[str, None] = None): 10 | if q: 11 | return {"item_id": item_id, "q": q} 12 | return {"item_id": item_id} 13 | -------------------------------------------------------------------------------- /docs_src/query_params/tutorial002_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/{item_id}") 7 | async def read_item(item_id: str, q: str | None = None): 8 | if q: 9 | return {"item_id": item_id, "q": q} 10 | return {"item_id": item_id} 11 | -------------------------------------------------------------------------------- /docs_src/query_params/tutorial005.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/{item_id}") 7 | async def read_user_item(item_id: str, needy: str): 8 | item = {"item_id": item_id, "needy": needy} 9 | return item 10 | -------------------------------------------------------------------------------- /docs_src/query_params/tutorial006.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/{item_id}") 9 | async def read_user_item( 10 | item_id: str, needy: str, skip: int = 0, limit: Union[int, None] = None 11 | ): 12 | item = {"item_id": item_id, "needy": needy, "skip": skip, "limit": limit} 13 | return item 14 | -------------------------------------------------------------------------------- /docs_src/query_params/tutorial006_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/{item_id}") 7 | async def read_user_item( 8 | item_id: str, needy: str, skip: int = 0, limit: int | None = None 9 | ): 10 | item = {"item_id": item_id, "needy": needy, "skip": skip, "limit": limit} 11 | return item 12 | -------------------------------------------------------------------------------- /docs_src/query_params/tutorial006b.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/{item_id}") 9 | async def read_user_item( 10 | item_id: str, needy: str, skip: int = 0, limit: Union[int, None] = None 11 | ): 12 | item = {"item_id": item_id, "needy": needy, "skip": skip, "limit": limit} 13 | return item 14 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial001.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Union[str, None] = None): 10 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 11 | if q: 12 | results.update({"q": q}) 13 | return results 14 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial001_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(q: str | None = None): 8 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 9 | if q: 10 | results.update({"q": q}) 11 | return results 12 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial002.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Union[str, None] = Query(default=None, max_length=50)): 10 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 11 | if q: 12 | results.update({"q": q}) 13 | return results 14 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial002_an_py310.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Annotated[str | None, Query(max_length=50)] = None): 10 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 11 | if q: 12 | results.update({"q": q}) 13 | return results 14 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial002_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(q: str | None = Query(default=None, max_length=50)): 8 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 9 | if q: 10 | results.update({"q": q}) 11 | return results 12 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial003.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items( 10 | q: Union[str, None] = Query(default=None, min_length=3, max_length=50), 11 | ): 12 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 13 | if q: 14 | results.update({"q": q}) 15 | return results 16 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial003_an_py310.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items( 10 | q: Annotated[str | None, Query(min_length=3, max_length=50)] = None, 11 | ): 12 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 13 | if q: 14 | results.update({"q": q}) 15 | return results 16 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial003_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(q: str | None = Query(default=None, min_length=3, max_length=50)): 8 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 9 | if q: 10 | results.update({"q": q}) 11 | return results 12 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial004_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items( 8 | q: str | None = Query( 9 | default=None, min_length=3, max_length=50, pattern="^fixedquery$" 10 | ), 11 | ): 12 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 13 | if q: 14 | results.update({"q": q}) 15 | return results 16 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial005.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(q: str = Query(default="fixedquery", min_length=3)): 8 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 9 | if q: 10 | results.update({"q": q}) 11 | return results 12 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial005_an.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | from typing_extensions import Annotated 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/items/") 8 | async def read_items(q: Annotated[str, Query(min_length=3)] = "fixedquery"): 9 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 10 | if q: 11 | results.update({"q": q}) 12 | return results 13 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial005_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Annotated[str, Query(min_length=3)] = "fixedquery"): 10 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 11 | if q: 12 | results.update({"q": q}) 13 | return results 14 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial006.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(q: str = Query(min_length=3)): 8 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 9 | if q: 10 | results.update({"q": q}) 11 | return results 12 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial006_an.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | from typing_extensions import Annotated 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/items/") 8 | async def read_items(q: Annotated[str, Query(min_length=3)]): 9 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 10 | if q: 11 | results.update({"q": q}) 12 | return results 13 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial006_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Annotated[str, Query(min_length=3)]): 10 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 11 | if q: 12 | results.update({"q": q}) 13 | return results 14 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial006b.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(q: str = Query(default=..., min_length=3)): 8 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 9 | if q: 10 | results.update({"q": q}) 11 | return results 12 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial006b_an.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | from typing_extensions import Annotated 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/items/") 8 | async def read_items(q: Annotated[str, Query(min_length=3)] = ...): 9 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 10 | if q: 11 | results.update({"q": q}) 12 | return results 13 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial006b_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Annotated[str, Query(min_length=3)] = ...): 10 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 11 | if q: 12 | results.update({"q": q}) 13 | return results 14 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial006c.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Union[str, None] = Query(default=..., min_length=3)): 10 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 11 | if q: 12 | results.update({"q": q}) 13 | return results 14 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial006c_an_py310.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Annotated[str | None, Query(min_length=3)] = ...): 10 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 11 | if q: 12 | results.update({"q": q}) 13 | return results 14 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial006c_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated, Union 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Annotated[Union[str, None], Query(min_length=3)] = ...): 10 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 11 | if q: 12 | results.update({"q": q}) 13 | return results 14 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial006c_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(q: str | None = Query(default=..., min_length=3)): 8 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 9 | if q: 10 | results.update({"q": q}) 11 | return results 12 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial006d.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(q: str = Query(default=..., min_length=3)): 8 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 9 | if q: 10 | results.update({"q": q}) 11 | return results 12 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial006d_an.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | from typing_extensions import Annotated 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/items/") 8 | async def read_items(q: Annotated[str, Query(min_length=3)] = ...): 9 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 10 | if q: 11 | results.update({"q": q}) 12 | return results 13 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial006d_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Annotated[str, Query(min_length=3)] = ...): 10 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 11 | if q: 12 | results.update({"q": q}) 13 | return results 14 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial007.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items( 10 | q: Union[str, None] = Query(default=None, title="Query string", min_length=3), 11 | ): 12 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 13 | if q: 14 | results.update({"q": q}) 15 | return results 16 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial007_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items( 8 | q: str | None = Query(default=None, title="Query string", min_length=3), 9 | ): 10 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 11 | if q: 12 | results.update({"q": q}) 13 | return results 14 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial009.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Union[str, None] = Query(default=None, alias="item-query")): 10 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 11 | if q: 12 | results.update({"q": q}) 13 | return results 14 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial009_an_py310.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Annotated[str | None, Query(alias="item-query")] = None): 10 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 11 | if q: 12 | results.update({"q": q}) 13 | return results 14 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial009_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated, Union 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Annotated[Union[str, None], Query(alias="item-query")] = None): 10 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 11 | if q: 12 | results.update({"q": q}) 13 | return results 14 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial009_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(q: str | None = Query(default=None, alias="item-query")): 8 | results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} 9 | if q: 10 | results.update({"q": q}) 11 | return results 12 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial011.py: -------------------------------------------------------------------------------- 1 | from typing import List, Union 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Union[List[str], None] = Query(default=None)): 10 | query_items = {"q": q} 11 | return query_items 12 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial011_an.py: -------------------------------------------------------------------------------- 1 | from typing import List, Union 2 | 3 | from fastapi import FastAPI, Query 4 | from typing_extensions import Annotated 5 | 6 | app = FastAPI() 7 | 8 | 9 | @app.get("/items/") 10 | async def read_items(q: Annotated[Union[List[str], None], Query()] = None): 11 | query_items = {"q": q} 12 | return query_items 13 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial011_an_py310.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Annotated[list[str] | None, Query()] = None): 10 | query_items = {"q": q} 11 | return query_items 12 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial011_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated, Union 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Annotated[Union[list[str], None], Query()] = None): 10 | query_items = {"q": q} 11 | return query_items 12 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial011_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(q: list[str] | None = Query(default=None)): 8 | query_items = {"q": q} 9 | return query_items 10 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial011_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Union[list[str], None] = Query(default=None)): 10 | query_items = {"q": q} 11 | return query_items 12 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial012.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: List[str] = Query(default=["foo", "bar"])): 10 | query_items = {"q": q} 11 | return query_items 12 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial012_an.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from fastapi import FastAPI, Query 4 | from typing_extensions import Annotated 5 | 6 | app = FastAPI() 7 | 8 | 9 | @app.get("/items/") 10 | async def read_items(q: Annotated[List[str], Query()] = ["foo", "bar"]): 11 | query_items = {"q": q} 12 | return query_items 13 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial012_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Annotated[list[str], Query()] = ["foo", "bar"]): 10 | query_items = {"q": q} 11 | return query_items 12 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial012_py39.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(q: list[str] = Query(default=["foo", "bar"])): 8 | query_items = {"q": q} 9 | return query_items 10 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial013.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items(q: list = Query(default=[])): 8 | query_items = {"q": q} 9 | return query_items 10 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial013_an.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | from typing_extensions import Annotated 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/items/") 8 | async def read_items(q: Annotated[list, Query()] = []): 9 | query_items = {"q": q} 10 | return query_items 11 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial013_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items(q: Annotated[list, Query()] = []): 10 | query_items = {"q": q} 11 | return query_items 12 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial014.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items( 10 | hidden_query: Union[str, None] = Query(default=None, include_in_schema=False), 11 | ): 12 | if hidden_query: 13 | return {"hidden_query": hidden_query} 14 | else: 15 | return {"hidden_query": "Not found"} 16 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial014_an_py310.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Query 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/items/") 9 | async def read_items( 10 | hidden_query: Annotated[str | None, Query(include_in_schema=False)] = None, 11 | ): 12 | if hidden_query: 13 | return {"hidden_query": hidden_query} 14 | else: 15 | return {"hidden_query": "Not found"} 16 | -------------------------------------------------------------------------------- /docs_src/query_params_str_validations/tutorial014_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Query 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/") 7 | async def read_items( 8 | hidden_query: str | None = Query(default=None, include_in_schema=False), 9 | ): 10 | if hidden_query: 11 | return {"hidden_query": hidden_query} 12 | else: 13 | return {"hidden_query": "Not found"} 14 | -------------------------------------------------------------------------------- /docs_src/request_files/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, File, UploadFile 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.post("/files/") 7 | async def create_file(file: bytes = File()): 8 | return {"file_size": len(file)} 9 | 10 | 11 | @app.post("/uploadfile/") 12 | async def create_upload_file(file: UploadFile): 13 | return {"filename": file.filename} 14 | -------------------------------------------------------------------------------- /docs_src/request_files/tutorial001_an.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, File, UploadFile 2 | from typing_extensions import Annotated 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.post("/files/") 8 | async def create_file(file: Annotated[bytes, File()]): 9 | return {"file_size": len(file)} 10 | 11 | 12 | @app.post("/uploadfile/") 13 | async def create_upload_file(file: UploadFile): 14 | return {"filename": file.filename} 15 | -------------------------------------------------------------------------------- /docs_src/request_files/tutorial001_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, File, UploadFile 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.post("/files/") 9 | async def create_file(file: Annotated[bytes, File()]): 10 | return {"file_size": len(file)} 11 | 12 | 13 | @app.post("/uploadfile/") 14 | async def create_upload_file(file: UploadFile): 15 | return {"filename": file.filename} 16 | -------------------------------------------------------------------------------- /docs_src/request_form_models/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Form 2 | from pydantic import BaseModel 3 | 4 | app = FastAPI() 5 | 6 | 7 | class FormData(BaseModel): 8 | username: str 9 | password: str 10 | 11 | 12 | @app.post("/login/") 13 | async def login(data: FormData = Form()): 14 | return data 15 | -------------------------------------------------------------------------------- /docs_src/request_form_models/tutorial001_an.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Form 2 | from pydantic import BaseModel 3 | from typing_extensions import Annotated 4 | 5 | app = FastAPI() 6 | 7 | 8 | class FormData(BaseModel): 9 | username: str 10 | password: str 11 | 12 | 13 | @app.post("/login/") 14 | async def login(data: Annotated[FormData, Form()]): 15 | return data 16 | -------------------------------------------------------------------------------- /docs_src/request_form_models/tutorial001_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Form 4 | from pydantic import BaseModel 5 | 6 | app = FastAPI() 7 | 8 | 9 | class FormData(BaseModel): 10 | username: str 11 | password: str 12 | 13 | 14 | @app.post("/login/") 15 | async def login(data: Annotated[FormData, Form()]): 16 | return data 17 | -------------------------------------------------------------------------------- /docs_src/request_form_models/tutorial002.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Form 2 | from pydantic import BaseModel 3 | 4 | app = FastAPI() 5 | 6 | 7 | class FormData(BaseModel): 8 | username: str 9 | password: str 10 | model_config = {"extra": "forbid"} 11 | 12 | 13 | @app.post("/login/") 14 | async def login(data: FormData = Form()): 15 | return data 16 | -------------------------------------------------------------------------------- /docs_src/request_form_models/tutorial002_an.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Form 2 | from pydantic import BaseModel 3 | from typing_extensions import Annotated 4 | 5 | app = FastAPI() 6 | 7 | 8 | class FormData(BaseModel): 9 | username: str 10 | password: str 11 | model_config = {"extra": "forbid"} 12 | 13 | 14 | @app.post("/login/") 15 | async def login(data: Annotated[FormData, Form()]): 16 | return data 17 | -------------------------------------------------------------------------------- /docs_src/request_form_models/tutorial002_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Form 4 | from pydantic import BaseModel 5 | 6 | app = FastAPI() 7 | 8 | 9 | class FormData(BaseModel): 10 | username: str 11 | password: str 12 | model_config = {"extra": "forbid"} 13 | 14 | 15 | @app.post("/login/") 16 | async def login(data: Annotated[FormData, Form()]): 17 | return data 18 | -------------------------------------------------------------------------------- /docs_src/request_form_models/tutorial002_pv1.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Form 2 | from pydantic import BaseModel 3 | 4 | app = FastAPI() 5 | 6 | 7 | class FormData(BaseModel): 8 | username: str 9 | password: str 10 | 11 | class Config: 12 | extra = "forbid" 13 | 14 | 15 | @app.post("/login/") 16 | async def login(data: FormData = Form()): 17 | return data 18 | -------------------------------------------------------------------------------- /docs_src/request_form_models/tutorial002_pv1_an.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Form 2 | from pydantic import BaseModel 3 | from typing_extensions import Annotated 4 | 5 | app = FastAPI() 6 | 7 | 8 | class FormData(BaseModel): 9 | username: str 10 | password: str 11 | 12 | class Config: 13 | extra = "forbid" 14 | 15 | 16 | @app.post("/login/") 17 | async def login(data: Annotated[FormData, Form()]): 18 | return data 19 | -------------------------------------------------------------------------------- /docs_src/request_form_models/tutorial002_pv1_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Form 4 | from pydantic import BaseModel 5 | 6 | app = FastAPI() 7 | 8 | 9 | class FormData(BaseModel): 10 | username: str 11 | password: str 12 | 13 | class Config: 14 | extra = "forbid" 15 | 16 | 17 | @app.post("/login/") 18 | async def login(data: Annotated[FormData, Form()]): 19 | return data 20 | -------------------------------------------------------------------------------- /docs_src/request_forms/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Form 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.post("/login/") 7 | async def login(username: str = Form(), password: str = Form()): 8 | return {"username": username} 9 | -------------------------------------------------------------------------------- /docs_src/request_forms/tutorial001_an.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Form 2 | from typing_extensions import Annotated 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.post("/login/") 8 | async def login(username: Annotated[str, Form()], password: Annotated[str, Form()]): 9 | return {"username": username} 10 | -------------------------------------------------------------------------------- /docs_src/request_forms/tutorial001_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import FastAPI, Form 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.post("/login/") 9 | async def login(username: Annotated[str, Form()], password: Annotated[str, Form()]): 10 | return {"username": username} 11 | -------------------------------------------------------------------------------- /docs_src/request_forms_and_files/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, File, Form, UploadFile 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.post("/files/") 7 | async def create_file( 8 | file: bytes = File(), fileb: UploadFile = File(), token: str = Form() 9 | ): 10 | return { 11 | "file_size": len(file), 12 | "token": token, 13 | "fileb_content_type": fileb.content_type, 14 | } 15 | -------------------------------------------------------------------------------- /docs_src/response_cookies/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.responses import JSONResponse 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.post("/cookie/") 8 | def create_cookie(): 9 | content = {"message": "Come to the dark side, we have cookies"} 10 | response = JSONResponse(content=content) 11 | response.set_cookie(key="fakesession", value="fake-cookie-session-value") 12 | return response 13 | -------------------------------------------------------------------------------- /docs_src/response_cookies/tutorial002.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Response 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.post("/cookie-and-object/") 7 | def create_cookie(response: Response): 8 | response.set_cookie(key="fakesession", value="fake-cookie-session-value") 9 | return {"message": "Come to the dark side, we have cookies"} 10 | -------------------------------------------------------------------------------- /docs_src/response_headers/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.responses import JSONResponse 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/headers/") 8 | def get_headers(): 9 | content = {"message": "Hello World"} 10 | headers = {"X-Cat-Dog": "alone in the world", "Content-Language": "en-US"} 11 | return JSONResponse(content=content, headers=headers) 12 | -------------------------------------------------------------------------------- /docs_src/response_headers/tutorial002.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Response 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/headers-and-object/") 7 | def get_headers(response: Response): 8 | response.headers["X-Cat-Dog"] = "alone in the world" 9 | return {"message": "Hello World"} 10 | -------------------------------------------------------------------------------- /docs_src/response_model/tutorial002_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from pydantic import BaseModel, EmailStr 3 | 4 | app = FastAPI() 5 | 6 | 7 | class UserIn(BaseModel): 8 | username: str 9 | password: str 10 | email: EmailStr 11 | full_name: str | None = None 12 | 13 | 14 | # Don't do this in production! 15 | @app.post("/user/") 16 | async def create_user(user: UserIn) -> UserIn: 17 | return user 18 | -------------------------------------------------------------------------------- /docs_src/response_model/tutorial003_01_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from pydantic import BaseModel, EmailStr 3 | 4 | app = FastAPI() 5 | 6 | 7 | class BaseUser(BaseModel): 8 | username: str 9 | email: EmailStr 10 | full_name: str | None = None 11 | 12 | 13 | class UserIn(BaseUser): 14 | password: str 15 | 16 | 17 | @app.post("/user/") 18 | async def create_user(user: UserIn) -> BaseUser: 19 | return user 20 | -------------------------------------------------------------------------------- /docs_src/response_model/tutorial003_03.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.responses import RedirectResponse 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/teleport") 8 | async def get_teleport() -> RedirectResponse: 9 | return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ") 10 | -------------------------------------------------------------------------------- /docs_src/response_model/tutorial003_04_py310.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Response 2 | from fastapi.responses import RedirectResponse 3 | 4 | app = FastAPI() 5 | 6 | 7 | @app.get("/portal") 8 | async def get_portal(teleport: bool = False) -> Response | dict: 9 | if teleport: 10 | return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ") 11 | return {"message": "Here's your interdimensional portal."} 12 | -------------------------------------------------------------------------------- /docs_src/response_status_code/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.post("/items/", status_code=201) 7 | async def create_item(name: str): 8 | return {"name": name} 9 | -------------------------------------------------------------------------------- /docs_src/response_status_code/tutorial002.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, status 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.post("/items/", status_code=status.HTTP_201_CREATED) 7 | async def create_item(name: str): 8 | return {"name": name} 9 | -------------------------------------------------------------------------------- /docs_src/security/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import Depends, FastAPI 2 | from fastapi.security import OAuth2PasswordBearer 3 | 4 | app = FastAPI() 5 | 6 | oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") 7 | 8 | 9 | @app.get("/items/") 10 | async def read_items(token: str = Depends(oauth2_scheme)): 11 | return {"token": token} 12 | -------------------------------------------------------------------------------- /docs_src/security/tutorial001_an.py: -------------------------------------------------------------------------------- 1 | from fastapi import Depends, FastAPI 2 | from fastapi.security import OAuth2PasswordBearer 3 | from typing_extensions import Annotated 4 | 5 | app = FastAPI() 6 | 7 | oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") 8 | 9 | 10 | @app.get("/items/") 11 | async def read_items(token: Annotated[str, Depends(oauth2_scheme)]): 12 | return {"token": token} 13 | -------------------------------------------------------------------------------- /docs_src/security/tutorial001_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import Depends, FastAPI 4 | from fastapi.security import OAuth2PasswordBearer 5 | 6 | app = FastAPI() 7 | 8 | oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") 9 | 10 | 11 | @app.get("/items/") 12 | async def read_items(token: Annotated[str, Depends(oauth2_scheme)]): 13 | return {"token": token} 14 | -------------------------------------------------------------------------------- /docs_src/security/tutorial006.py: -------------------------------------------------------------------------------- 1 | from fastapi import Depends, FastAPI 2 | from fastapi.security import HTTPBasic, HTTPBasicCredentials 3 | 4 | app = FastAPI() 5 | 6 | security = HTTPBasic() 7 | 8 | 9 | @app.get("/users/me") 10 | def read_current_user(credentials: HTTPBasicCredentials = Depends(security)): 11 | return {"username": credentials.username, "password": credentials.password} 12 | -------------------------------------------------------------------------------- /docs_src/security/tutorial006_an.py: -------------------------------------------------------------------------------- 1 | from fastapi import Depends, FastAPI 2 | from fastapi.security import HTTPBasic, HTTPBasicCredentials 3 | from typing_extensions import Annotated 4 | 5 | app = FastAPI() 6 | 7 | security = HTTPBasic() 8 | 9 | 10 | @app.get("/users/me") 11 | def read_current_user(credentials: Annotated[HTTPBasicCredentials, Depends(security)]): 12 | return {"username": credentials.username, "password": credentials.password} 13 | -------------------------------------------------------------------------------- /docs_src/security/tutorial006_an_py39.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | 3 | from fastapi import Depends, FastAPI 4 | from fastapi.security import HTTPBasic, HTTPBasicCredentials 5 | 6 | app = FastAPI() 7 | 8 | security = HTTPBasic() 9 | 10 | 11 | @app.get("/users/me") 12 | def read_current_user(credentials: Annotated[HTTPBasicCredentials, Depends(security)]): 13 | return {"username": credentials.username, "password": credentials.password} 14 | -------------------------------------------------------------------------------- /docs_src/settings/app01/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/settings/app01/__init__.py -------------------------------------------------------------------------------- /docs_src/settings/app01/config.py: -------------------------------------------------------------------------------- 1 | from pydantic_settings import BaseSettings 2 | 3 | 4 | class Settings(BaseSettings): 5 | app_name: str = "Awesome API" 6 | admin_email: str 7 | items_per_user: int = 50 8 | 9 | 10 | settings = Settings() 11 | -------------------------------------------------------------------------------- /docs_src/settings/app01/main.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | from .config import settings 4 | 5 | app = FastAPI() 6 | 7 | 8 | @app.get("/info") 9 | async def info(): 10 | return { 11 | "app_name": settings.app_name, 12 | "admin_email": settings.admin_email, 13 | "items_per_user": settings.items_per_user, 14 | } 15 | -------------------------------------------------------------------------------- /docs_src/settings/app02/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/settings/app02/__init__.py -------------------------------------------------------------------------------- /docs_src/settings/app02/config.py: -------------------------------------------------------------------------------- 1 | from pydantic_settings import BaseSettings 2 | 3 | 4 | class Settings(BaseSettings): 5 | app_name: str = "Awesome API" 6 | admin_email: str 7 | items_per_user: int = 50 8 | -------------------------------------------------------------------------------- /docs_src/settings/app02_an/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/settings/app02_an/__init__.py -------------------------------------------------------------------------------- /docs_src/settings/app02_an/config.py: -------------------------------------------------------------------------------- 1 | from pydantic_settings import BaseSettings 2 | 3 | 4 | class Settings(BaseSettings): 5 | app_name: str = "Awesome API" 6 | admin_email: str 7 | items_per_user: int = 50 8 | -------------------------------------------------------------------------------- /docs_src/settings/app02_an_py39/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/settings/app02_an_py39/__init__.py -------------------------------------------------------------------------------- /docs_src/settings/app02_an_py39/config.py: -------------------------------------------------------------------------------- 1 | from pydantic_settings import BaseSettings 2 | 3 | 4 | class Settings(BaseSettings): 5 | app_name: str = "Awesome API" 6 | admin_email: str 7 | items_per_user: int = 50 8 | -------------------------------------------------------------------------------- /docs_src/settings/app03/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/settings/app03/__init__.py -------------------------------------------------------------------------------- /docs_src/settings/app03/config.py: -------------------------------------------------------------------------------- 1 | from pydantic_settings import BaseSettings 2 | 3 | 4 | class Settings(BaseSettings): 5 | app_name: str = "Awesome API" 6 | admin_email: str 7 | items_per_user: int = 50 8 | 9 | class Config: 10 | env_file = ".env" 11 | -------------------------------------------------------------------------------- /docs_src/settings/app03_an/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/settings/app03_an/__init__.py -------------------------------------------------------------------------------- /docs_src/settings/app03_an/config.py: -------------------------------------------------------------------------------- 1 | from pydantic_settings import BaseSettings, SettingsConfigDict 2 | 3 | 4 | class Settings(BaseSettings): 5 | app_name: str = "Awesome API" 6 | admin_email: str 7 | items_per_user: int = 50 8 | 9 | model_config = SettingsConfigDict(env_file=".env") 10 | -------------------------------------------------------------------------------- /docs_src/settings/app03_an/config_pv1.py: -------------------------------------------------------------------------------- 1 | from pydantic import BaseSettings 2 | 3 | 4 | class Settings(BaseSettings): 5 | app_name: str = "Awesome API" 6 | admin_email: str 7 | items_per_user: int = 50 8 | 9 | class Config: 10 | env_file = ".env" 11 | -------------------------------------------------------------------------------- /docs_src/settings/app03_an_py39/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/settings/app03_an_py39/__init__.py -------------------------------------------------------------------------------- /docs_src/settings/app03_an_py39/config.py: -------------------------------------------------------------------------------- 1 | from pydantic_settings import BaseSettings 2 | 3 | 4 | class Settings(BaseSettings): 5 | app_name: str = "Awesome API" 6 | admin_email: str 7 | items_per_user: int = 50 8 | 9 | class Config: 10 | env_file = ".env" 11 | -------------------------------------------------------------------------------- /docs_src/sql_databases/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/sql_databases/__init__.py -------------------------------------------------------------------------------- /docs_src/static_files/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.staticfiles import StaticFiles 3 | 4 | app = FastAPI() 5 | 6 | app.mount("/static", StaticFiles(directory="static"), name="static") 7 | -------------------------------------------------------------------------------- /docs_src/sub_applications/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/app") 7 | def read_main(): 8 | return {"message": "Hello World from main app"} 9 | 10 | 11 | subapi = FastAPI() 12 | 13 | 14 | @subapi.get("/sub") 15 | def read_sub(): 16 | return {"message": "Hello World from sub API"} 17 | 18 | 19 | app.mount("/subapi", subapi) 20 | -------------------------------------------------------------------------------- /docs_src/templates/static/styles.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | color: green; 3 | } 4 | -------------------------------------------------------------------------------- /docs_src/templates/templates/item.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Item Details 4 | 5 | 6 | 7 |

Item ID: {{ id }}

8 | 9 | 10 | -------------------------------------------------------------------------------- /docs_src/using_request_directly/tutorial001.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, Request 2 | 3 | app = FastAPI() 4 | 5 | 6 | @app.get("/items/{item_id}") 7 | def read_root(item_id: str, request: Request): 8 | client_host = request.client.host 9 | return {"client_host": client_host, "item_id": item_id} 10 | -------------------------------------------------------------------------------- /docs_src/websockets/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/docs_src/websockets/__init__.py -------------------------------------------------------------------------------- /fastapi/__main__.py: -------------------------------------------------------------------------------- 1 | from fastapi.cli import main 2 | 3 | main() 4 | -------------------------------------------------------------------------------- /fastapi/dependencies/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/fastapi/dependencies/__init__.py -------------------------------------------------------------------------------- /fastapi/logger.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("fastapi") 4 | -------------------------------------------------------------------------------- /fastapi/middleware/__init__.py: -------------------------------------------------------------------------------- 1 | from starlette.middleware import Middleware as Middleware 2 | -------------------------------------------------------------------------------- /fastapi/middleware/cors.py: -------------------------------------------------------------------------------- 1 | from starlette.middleware.cors import CORSMiddleware as CORSMiddleware # noqa 2 | -------------------------------------------------------------------------------- /fastapi/middleware/gzip.py: -------------------------------------------------------------------------------- 1 | from starlette.middleware.gzip import GZipMiddleware as GZipMiddleware # noqa 2 | -------------------------------------------------------------------------------- /fastapi/middleware/httpsredirect.py: -------------------------------------------------------------------------------- 1 | from starlette.middleware.httpsredirect import ( # noqa 2 | HTTPSRedirectMiddleware as HTTPSRedirectMiddleware, 3 | ) 4 | -------------------------------------------------------------------------------- /fastapi/middleware/trustedhost.py: -------------------------------------------------------------------------------- 1 | from starlette.middleware.trustedhost import ( # noqa 2 | TrustedHostMiddleware as TrustedHostMiddleware, 3 | ) 4 | -------------------------------------------------------------------------------- /fastapi/middleware/wsgi.py: -------------------------------------------------------------------------------- 1 | from starlette.middleware.wsgi import WSGIMiddleware as WSGIMiddleware # noqa 2 | -------------------------------------------------------------------------------- /fastapi/openapi/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/fastapi/openapi/__init__.py -------------------------------------------------------------------------------- /fastapi/openapi/constants.py: -------------------------------------------------------------------------------- 1 | METHODS_WITH_BODY = {"GET", "HEAD", "POST", "PUT", "DELETE", "PATCH"} 2 | REF_PREFIX = "#/components/schemas/" 3 | REF_TEMPLATE = "#/components/schemas/{model}" 4 | -------------------------------------------------------------------------------- /fastapi/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/fastapi/py.typed -------------------------------------------------------------------------------- /fastapi/requests.py: -------------------------------------------------------------------------------- 1 | from starlette.requests import HTTPConnection as HTTPConnection # noqa: F401 2 | from starlette.requests import Request as Request # noqa: F401 3 | -------------------------------------------------------------------------------- /fastapi/security/base.py: -------------------------------------------------------------------------------- 1 | from fastapi.openapi.models import SecurityBase as SecurityBaseModel 2 | 3 | 4 | class SecurityBase: 5 | model: SecurityBaseModel 6 | scheme_name: str 7 | -------------------------------------------------------------------------------- /fastapi/security/utils.py: -------------------------------------------------------------------------------- 1 | from typing import Optional, Tuple 2 | 3 | 4 | def get_authorization_scheme_param( 5 | authorization_header_value: Optional[str], 6 | ) -> Tuple[str, str]: 7 | if not authorization_header_value: 8 | return "", "" 9 | scheme, _, param = authorization_header_value.partition(" ") 10 | return scheme, param 11 | -------------------------------------------------------------------------------- /fastapi/staticfiles.py: -------------------------------------------------------------------------------- 1 | from starlette.staticfiles import StaticFiles as StaticFiles # noqa 2 | -------------------------------------------------------------------------------- /fastapi/templating.py: -------------------------------------------------------------------------------- 1 | from starlette.templating import Jinja2Templates as Jinja2Templates # noqa 2 | -------------------------------------------------------------------------------- /fastapi/testclient.py: -------------------------------------------------------------------------------- 1 | from starlette.testclient import TestClient as TestClient # noqa 2 | -------------------------------------------------------------------------------- /fastapi/types.py: -------------------------------------------------------------------------------- 1 | import types 2 | from enum import Enum 3 | from typing import Any, Callable, Dict, Set, Type, TypeVar, Union 4 | 5 | from pydantic import BaseModel 6 | 7 | DecoratedCallable = TypeVar("DecoratedCallable", bound=Callable[..., Any]) 8 | UnionType = getattr(types, "UnionType", Union) 9 | ModelNameMap = Dict[Union[Type[BaseModel], Type[Enum]], str] 10 | IncEx = Union[Set[int], Set[str], Dict[int, Any], Dict[str, Any]] 11 | -------------------------------------------------------------------------------- /fastapi/websockets.py: -------------------------------------------------------------------------------- 1 | from starlette.websockets import WebSocket as WebSocket # noqa 2 | from starlette.websockets import WebSocketDisconnect as WebSocketDisconnect # noqa 3 | from starlette.websockets import WebSocketState as WebSocketState # noqa 4 | -------------------------------------------------------------------------------- /requirements-docs-insiders.txt: -------------------------------------------------------------------------------- 1 | git+https://${TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git@9.5.30-insiders-4.53.11 2 | git+https://${TOKEN}@github.com/pawamoy-insiders/griffe-typing-deprecated.git 3 | git+https://${TOKEN}@github.com/pawamoy-insiders/mkdocstrings-python.git 4 | -------------------------------------------------------------------------------- /requirements-docs-tests.txt: -------------------------------------------------------------------------------- 1 | # For mkdocstrings and tests 2 | httpx >=0.23.0,<0.28.0 3 | # For linting and generating docs versions 4 | ruff ==0.6.4 5 | -------------------------------------------------------------------------------- /requirements-github-actions.txt: -------------------------------------------------------------------------------- 1 | PyGithub>=2.3.0,<3.0.0 2 | pydantic>=2.5.3,<3.0.0 3 | pydantic-settings>=2.1.0,<3.0.0 4 | httpx>=0.27.0,<0.28.0 5 | pyyaml >=5.3.1,<7.0.0 6 | smokeshow 7 | -------------------------------------------------------------------------------- /requirements-tests.txt: -------------------------------------------------------------------------------- 1 | -e .[all] 2 | -r requirements-docs-tests.txt 3 | pytest >=7.1.3,<9.0.0 4 | coverage[toml] >= 6.5.0,< 8.0 5 | mypy ==1.8.0 6 | dirty-equals ==0.8.0 7 | sqlmodel==0.0.22 8 | flask >=1.1.2,<4.0.0 9 | anyio[trio] >=3.2.1,<4.0.0 10 | PyJWT==2.8.0 11 | pyyaml >=5.3.1,<7.0.0 12 | passlib[bcrypt] >=1.7.2,<2.0.0 13 | inline-snapshot==0.18.1 14 | # types 15 | types-ujson ==5.10.0.20240515 16 | types-orjson ==3.6.2 17 | -------------------------------------------------------------------------------- /requirements-translations.txt: -------------------------------------------------------------------------------- 1 | pydantic-ai==0.0.15 2 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | -e .[all] 2 | -r requirements-tests.txt 3 | -r requirements-docs.txt 4 | pre-commit >=2.17.0,<5.0.0 5 | # For generating screenshots 6 | playwright 7 | -------------------------------------------------------------------------------- /scripts/format.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -x 3 | 4 | ruff check fastapi tests docs_src scripts --fix 5 | ruff format fastapi tests docs_src scripts 6 | -------------------------------------------------------------------------------- /scripts/lint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | set -x 5 | 6 | mypy fastapi 7 | ruff check fastapi tests docs_src scripts 8 | ruff format fastapi tests --check 9 | -------------------------------------------------------------------------------- /scripts/test-cov-html.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | set -x 5 | 6 | bash scripts/test.sh ${@} 7 | coverage combine 8 | coverage report 9 | coverage html 10 | -------------------------------------------------------------------------------- /scripts/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | set -x 5 | 6 | export PYTHONPATH=./docs_src 7 | coverage run -m pytest tests ${@} 8 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/__init__.py -------------------------------------------------------------------------------- /tests/test_filter_pydantic_sub_model/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_filter_pydantic_sub_model/__init__.py -------------------------------------------------------------------------------- /tests/test_modules_same_name_body/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_modules_same_name_body/__init__.py -------------------------------------------------------------------------------- /tests/test_modules_same_name_body/app/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_modules_same_name_body/app/__init__.py -------------------------------------------------------------------------------- /tests/test_modules_same_name_body/app/a.py: -------------------------------------------------------------------------------- 1 | from fastapi import APIRouter, Body 2 | 3 | router = APIRouter() 4 | 5 | 6 | @router.post("/compute") 7 | def compute(a: int = Body(), b: str = Body()): 8 | return {"a": a, "b": b} 9 | -------------------------------------------------------------------------------- /tests/test_modules_same_name_body/app/b.py: -------------------------------------------------------------------------------- 1 | from fastapi import APIRouter, Body 2 | 3 | router = APIRouter() 4 | 5 | 6 | @router.post("/compute/") 7 | def compute(a: int = Body(), b: str = Body()): 8 | return {"a": a, "b": b} 9 | -------------------------------------------------------------------------------- /tests/test_modules_same_name_body/app/main.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | 3 | from . import a, b 4 | 5 | app = FastAPI() 6 | 7 | app.include_router(a.router, prefix="/a") 8 | app.include_router(b.router, prefix="/b") 9 | -------------------------------------------------------------------------------- /tests/test_tutorial/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_additional_responses/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_additional_responses/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_additional_status_codes/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_additional_status_codes/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_advanced_middleware/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_advanced_middleware/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_async_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_async_tests/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_async_tests/test_main.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from docs_src.async_tests.test_main import test_root 4 | 5 | 6 | @pytest.mark.anyio 7 | async def test_async_testing(): 8 | await test_root() 9 | -------------------------------------------------------------------------------- /tests/test_tutorial/test_background_tasks/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_background_tasks/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_behind_a_proxy/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_behind_a_proxy/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_bigger_applications/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_bigger_applications/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_body/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_body/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_body_fields/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_body_fields/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_body_multiple_params/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_body_multiple_params/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_body_nested_models/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_body_nested_models/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_body_updates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_body_updates/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_conditional_openapi/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_conditional_openapi/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_configure_swagger_ui/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_configure_swagger_ui/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_cookie_param_models/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_cookie_param_models/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_cookie_params/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_cookie_params/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_cors/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_cors/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_custom_docs_ui/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_custom_docs_ui/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_custom_request_and_route/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_custom_request_and_route/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_custom_response/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_custom_response/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_custom_response/test_tutorial007.py: -------------------------------------------------------------------------------- 1 | from fastapi.testclient import TestClient 2 | 3 | from docs_src.custom_response.tutorial007 import app 4 | 5 | client = TestClient(app) 6 | 7 | 8 | def test_get(): 9 | fake_content = b"some fake video bytes" 10 | response = client.get("/") 11 | assert response.content == fake_content * 10 12 | -------------------------------------------------------------------------------- /tests/test_tutorial/test_custom_response/test_tutorial009c.py: -------------------------------------------------------------------------------- 1 | from fastapi.testclient import TestClient 2 | 3 | from docs_src.custom_response.tutorial009c import app 4 | 5 | client = TestClient(app) 6 | 7 | 8 | def test_get(): 9 | response = client.get("/") 10 | assert response.content == b'{\n "message": "Hello World"\n}' 11 | -------------------------------------------------------------------------------- /tests/test_tutorial/test_dataclasses/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_dataclasses/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_dependencies/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_dependencies/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_events/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_events/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_extending_openapi/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_extending_openapi/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_extra_data_types/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_extra_data_types/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_extra_models/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_extra_models/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_first_steps/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_first_steps/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_generate_clients/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_generate_clients/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_handling_errors/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_handling_errors/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_header_param_models/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_header_param_models/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_header_params/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_header_params/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_metadata/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_metadata/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_openapi_callbacks/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_openapi_callbacks/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_openapi_webhooks/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_openapi_webhooks/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_path_operation_advanced_configurations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_path_operation_advanced_configurations/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_path_operation_configurations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_path_operation_configurations/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_path_params/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_path_params/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_query_param_models/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_query_param_models/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_query_params/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_query_params/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_query_params_str_validations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_query_params_str_validations/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_request_files/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_request_files/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_request_form_models/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_request_form_models/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_request_forms/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_request_forms/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_request_forms_and_files/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_request_forms_and_files/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_response_change_status_code/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_response_change_status_code/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_response_cookies/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_response_cookies/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_response_headers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_response_headers/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_response_model/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_response_model/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_response_model/test_tutorial003_04.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from fastapi.exceptions import FastAPIError 3 | 4 | 5 | def test_invalid_response_model(): 6 | with pytest.raises(FastAPIError): 7 | from docs_src.response_model.tutorial003_04 import app 8 | 9 | assert app # pragma: no cover 10 | -------------------------------------------------------------------------------- /tests/test_tutorial/test_response_model/test_tutorial003_04_py310.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from fastapi.exceptions import FastAPIError 3 | 4 | from ...utils import needs_py310 5 | 6 | 7 | @needs_py310 8 | def test_invalid_response_model(): 9 | with pytest.raises(FastAPIError): 10 | from docs_src.response_model.tutorial003_04_py310 import app 11 | 12 | assert app # pragma: no cover 13 | -------------------------------------------------------------------------------- /tests/test_tutorial/test_schema_extra_example/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_schema_extra_example/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_security/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_security/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_separate_openapi_schemas/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_separate_openapi_schemas/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_settings/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_settings/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_sql_databases/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_sql_databases/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_sub_applications/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_sub_applications/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_templates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_templates/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_testing/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_testing/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_testing/test_main_b.py: -------------------------------------------------------------------------------- 1 | from docs_src.app_testing.app_b import test_main 2 | 3 | 4 | def test_app(): 5 | test_main.test_create_existing_item() 6 | test_main.test_create_item() 7 | test_main.test_create_item_bad_token() 8 | test_main.test_read_nonexistent_item() 9 | test_main.test_read_item() 10 | test_main.test_read_item_bad_token() 11 | -------------------------------------------------------------------------------- /tests/test_tutorial/test_testing/test_main_b_an.py: -------------------------------------------------------------------------------- 1 | from docs_src.app_testing.app_b_an import test_main 2 | 3 | 4 | def test_app(): 5 | test_main.test_create_existing_item() 6 | test_main.test_create_item() 7 | test_main.test_create_item_bad_token() 8 | test_main.test_read_nonexistent_item() 9 | test_main.test_read_item() 10 | test_main.test_read_item_bad_token() 11 | -------------------------------------------------------------------------------- /tests/test_tutorial/test_testing/test_tutorial002.py: -------------------------------------------------------------------------------- 1 | from docs_src.app_testing.tutorial002 import test_read_main, test_websocket 2 | 3 | 4 | def test_main(): 5 | test_read_main() 6 | 7 | 8 | def test_ws(): 9 | test_websocket() 10 | -------------------------------------------------------------------------------- /tests/test_tutorial/test_testing/test_tutorial003.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def test_main(): 5 | with pytest.warns(DeprecationWarning): 6 | from docs_src.app_testing.tutorial003 import test_read_items 7 | test_read_items() 8 | -------------------------------------------------------------------------------- /tests/test_tutorial/test_testing_dependencies/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_testing_dependencies/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_websockets/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_websockets/__init__.py -------------------------------------------------------------------------------- /tests/test_tutorial/test_wsgi/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_tutorial/test_wsgi/__init__.py -------------------------------------------------------------------------------- /tests/test_validate_response_recursive/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yezz123/fastapi/2612fa3e9d17fe74c97029b55b5d64be2d38400f/tests/test_validate_response_recursive/__init__.py --------------------------------------------------------------------------------