Commit Graph

174 Commits

Author SHA1 Message Date
Sebastián Ramírez 0ac9b3ee5c
Re-export utils from Starlette (#1064)
*  Re-export main features used from Starlette to simplify developer's code

* ♻️ Refactor Starlette exports

* ♻️ Refactor tutorial examples to use re-exported utils from Starlette

* 📝 Add examples for all middlewares

* 📝 Add new docs for middlewares

* 📝 Add examples for custom responses

* 📝 Extend docs for custom responses

* 📝 Update docs and add notes explaining re-exports from Starlette everywhere

* 🍱 Update screenshot for HTTP status

* 🔧 Update MkDocs config with new content

* ♻️ Refactor tests to use re-exported utils from Starlette

*  Re-export WebSocketDisconnect from Starlette for tests

*  Add extra tests for extra re-exported middleware

*  Add tests for re-exported responses from Starlette

*  Add docs about mounting WSGI apps

*  Add Flask as a dependency to test WSGIMiddleware

*  Test WSGIMiddleware example
2020-03-01 21:49:20 +01:00
Vegard Stikbakke 48c2406495
🎨 Fix markdown code section rendering error in SQL tutorial (#1015) 2020-02-29 12:40:09 +01:00
Nikita Kolesov 8af4454251
✏️ Fix typo (#941) 2020-02-16 20:51:18 +01:00
Sebastián Ramírez adf252768c
📝 Update docs for dependencies with yield (#986) 2020-02-16 20:49:12 +01:00
Sebastián Ramírez 25e94d6344
Add mermaid.js support in Markdown fenced blocks for diagrams (#985) 2020-02-16 19:48:20 +01:00
Timothée Mazzucotelli 68723d5291
📝 Add note about Body parameters without Pydantic (#900) 2020-02-04 04:17:20 +01:00
linchiwei123 4f964939a1
🐛 Fix middleware docs link (#893) 2020-02-04 03:27:10 +01:00
Sebastián Ramírez b307d38897
♻️ Update default API title from "Fast API" to "FastAPI" for consistency (#890) 2020-01-18 19:07:42 +01:00
Sebastián Ramírez 22982287ff
📝 Refactor docs, "Tutorial - User Guide" and "Advanced User Guide" (#887) 2020-01-18 16:21:54 +01:00
Sebastián Ramírez a41a729682
🎨 Tweak external links, Markdown format, typos (#881) 2020-01-17 16:24:05 +01:00
Aviram Hassan 5db99a27cf add body to RequestValidationError for easier debugging (#853) 2020-01-17 12:37:44 +01:00
Sebastián Ramírez 3f53deebc9
🐛 Fix Peewee contextvars handling in docs (#879) 2020-01-17 09:59:38 +01:00
Zachary Wasserman ba9c9a3f78 🔒 Update HTTP Basic Auth docs fixing timing attacks (#807) 2020-01-12 20:38:39 +01:00
James Kaplan cb1410426e 🐛 Fix callback handling in sub-routers (#792) 2020-01-08 22:22:14 +01:00
Dustyposa 8d3dcbcd1b fix type UrlStr -> HttpUrl (#832) 2020-01-08 00:08:43 -08:00
Sebastián Ramírez 04c8502cc7
📝 Add docs for correctly using Peewee (#789) 2019-12-13 11:29:18 +01:00
Ben Dayan 73260971b5 Add support for OpenAPI Callbacks (#722) 2019-12-11 17:58:00 +01:00
Sebastián Ramírez a39efb029f
💬 Rephrase handling-errors to remove gender while keeping readability (#780) 2019-12-09 18:59:29 +01:00
prostomarkeloff 3f5f81bbdc 📝 Change 'Schema' to 'Field' in docs (#746) 2019-12-09 14:48:54 +01:00
bundabrg 28c089c029 ✏️ Fix typos in docs (#734) 2019-11-27 21:27:56 +01:00
Nicolas Marier 3cf8b86dc1 📝 Clarify docs for APIRouter dependencies (#698) 2019-11-27 21:00:34 +01:00
dmontagu ab2b86fe2c Add support for Pydantic v1 and above 🎉 (#646)
* Make compatible with pydantic v1

* Remove unused import

* Remove unused ignores

* Update pydantic version

* Fix minor formatting issue

*  Revert removing iterate_in_threadpool

*  Add backwards compatibility with Pydantic 0.32.2

with deprecation warnings

*  Update tests to not break when using Pydantic < 1.0.0

* 📝 Update docs for Pydantic version 1.0.0

* 📌 Update Pydantic range version to support from 0.32.2

* 🎨 Format test imports

*  Add support for Pydantic < 1.2 for populate_validators

*  Add backwards compatibility for Pydantic < 1.2.0 with required fields

* 📌 Relax requirement for Pydantic to < 2.0.0 🎉 🚀

* 💚 Update pragma coverage for older Pydantic versions
2019-11-27 20:32:02 +01:00
Steven Kalt bac2f587b7 📝 Document overriding operationId for all path operations using their function names (#642) 2019-11-24 15:00:51 +01:00
Daniel Brotsky c7902dd23a Generate correct OpenAPI docs for responses with no content (#621) 2019-11-24 14:15:39 +01:00
svalouch 723ef07ccf 📝 Add documentation for self-serving static Swagger UI (#112) (#557) 2019-11-23 22:50:58 +01:00
Sebastián Ramírez 3f9f4a0f8f
Add dependencies with yield (used as context managers) (#595)
*  Add development/testing dependencies for Python 3.6

*  Add concurrency submodule with contextmanager_in_threadpool

*  Add AsyncExitStack to ASGI scope in FastAPI app call

*  Use async stack for contextmanager-able dependencies

including running in threadpool sync dependencies

*  Add tests for contextmanager dependencies

including internal raise checks when exceptions should be handled and when not

*  Add test for fake asynccontextmanager raiser

* 🐛 Fix mypy errors and coverage

* 🔇 Remove development logs and prints

*  Add tests for sub-contextmanagers, background tasks, and sync functions

* 🐛 Fix mypy errors for Python 3.7

* 💬 Fix error texts for clarity

* 📝 Add docs for dependencies with yield

*  Update SQL with SQLAlchemy tutorial to use dependencies with yield

and add an alternative with a middleware (from the old tutorial)

*  Update SQL tests to remove DB file during the same tests

*  Add tests for example with middleware

as a copy from the tests with dependencies with yield, removing the DB in the tests

* ✏️ Fix typos with suggestions from code review

Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>
2019-10-09 13:01:58 -05:00
dmontagu 8c3ef76139 Add better support for request body access/manipulation with custom classes (#589) 2019-10-04 19:23:34 -05:00
sliptonic f4d753620b 📝 Add notes about installing python-multipart for forms (#574) 2019-10-04 15:33:42 -05:00
svalouch c7dc26b760 Allow docstrings to be truncated before being used for OpenAPI (#556) 2019-10-04 15:02:40 -05:00
prostomarkeloff 0761f11d1a ✏️ Fix typo in HTTP Basic auth tutorial (#514) 2019-10-03 19:01:41 -05:00
Fedor Ignatov d5d9a20937 📝 Fix incorrect example in docs - first steps (#511) 2019-10-03 18:57:49 -05:00
Pablo Marti 1ed5aa23e6 ✏️ Fix typo in oauth2-jwt.md (#447) 2019-08-30 17:35:52 -05:00
Chris Withers bdd251a05b 📝 Tweak wording on OAuth2 scopes (#371) 2019-07-12 18:17:34 -05:00
Sebastián Ramírez 9a71672a95
📝 Update enum examples to use str, and improve Swagger UI in examples (#351) 2019-06-28 21:27:27 +02:00
Sebastián Ramírez d3ea6f7514
📝 Add note to docs about including same router multiple times (#348) 2019-06-28 19:54:49 +02:00
Camila Gutierrez ab77c069d4 📝 Update, simplify, and clarify the SQL tutorial (#331) 2019-06-27 13:25:16 +02:00
cyril 1c2cdb97e9 📝 Add online SQLite browsers to docs (#330) 2019-06-27 13:12:38 +02:00
Sebastián Ramírez aa84ac8e3e
Implement support for Pydantic's ORM mode (#322)
*  Implement support for Pydantic's ORM mode

* 🏗️ Re-structure/augment SQL tutorial source using ORM mode

* 📝 Update SQL docs with SQLAlchemy, ORM mode, relationships

* 🔥 Remove unused util in tutorial

* 📝 Add tutorials for simple dict bodies and responses

* 🔥 Remove old SQL tutorial

*  Add/update tests for SQL tutorial

*  Add tests for simple dicts (body and response)

* 🐛 Fix cloning field from original field
2019-06-20 11:31:32 +02:00
dmontagu 120ab08360 📝 Update response-directly.md, fix link (#306) 2019-06-13 18:34:20 +02:00
Andrew Widdersheim 3f5521fdfb 📝 Fix default response model docs (#288)
Fix a discrepancy in the `tax` parameters default value between the docs
and the code example.
2019-06-13 18:31:48 +02:00
Sebastián Ramírez 5f7fe926ab
Add support for Response parameters to set headers, cookies, and status codes (#294)
*  Add support for declaring a Response parameter to set headers and cookies

*  Add source for docs and tests

* 📝 Add docs for setting headers, cookies and status code

* 📝 Add attribution to Hug for inspiring response parameters
2019-06-06 14:29:40 +04:00
Sebastián Ramírez bff5dbbf5d
Implement dependency value cache per request (#292)
*  Add dependency cache, with support for disabling it

*  Add tests for dependency cache

* 📝 Add docs about dependency value caching
2019-06-05 21:00:54 +04:00
Sebastián Ramírez 09cd7c47a1
Implement dependency overrides for testing (#291)
*  Implement dependency overrides for testing

*  Add docs source tests and extra tests for dependency overrides

* 📝 Add docs for testing dependencies with overrides
2019-06-05 15:43:18 +04:00
Sebastián Ramírez c7db2ff858
🐛 Fix path and query parameters receiving dict as valid (#287)
* 🐛 Fix path and query parameters accepting dict

*  Add several tests to ensure invalid types are not accepted

* 📝 Document (to include tested source) using query params with list

* 🐛 Fix OpenAPI schema in query with list tutorial
2019-06-03 21:59:40 +04:00
dmontagu 360a2797c1 🐛 Fix docs link in oauth2-scopes.md (#275)
#274
2019-05-30 17:43:18 +04:00
Sebastián Ramírez bd407cc4ed
Refactor param extraction using Pydantic Field (#278)
*  Refactor parameter dependency using Pydantic Field

* ⬆️ Upgrade required Pydantic version with latest Shape values

*  Add tutorials and code for using Enum and Optional

*  Add tests for tutorials with new types and extra cases

* ♻️ Format, clean, and add annotations to dependencies.utils

* 📝 Update tutorial for query parameters with list defaults

*  Add tests for query param with list default
2019-05-30 17:40:43 +04:00
Sebastián Ramírez 62af6e0eeb
Separate Pydantic's ValidationError handler and improve docs for error handling (#273)
*  Implement separated ValidationError handlers and custom exceptions

*  Add tutorial source examples and tests

* 📝 Add docs for custom exception handlers

* 📝 Update docs section titles
2019-05-29 16:27:55 +04:00
William Hayes d544bdf092 📝 Update docs for paths in path params (#256) 2019-05-29 13:43:41 +04:00
Sebastián Ramírez 24e9ea28d3
Update testing docs, examples for testing POST, headers (#271) 2019-05-29 11:47:21 +04:00
Sebastián Ramírez 7b63bc5551
Add include, exclude, and by_alias to path operation methods (#264)
*  Make jsonable_encoder's include and exclude receive sequences

*  Add include, exclude, and by_alias to app and router

*  Add and update tutorial code with new parameters

* 📝 Update docs for new parameters and add docs for updating data

*  Add tests for consistency in path operation methods

*  Add tests for new parameters and update tests
2019-05-27 16:08:13 +04:00