Commit Graph

424 Commits

Author SHA1 Message Date
Irfanuddin Shafi Ahmed 4d270463af
🐛Fix `RuntimeError` raised when `HTTPException` has a status code with no content (#5365)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-11 16:13:36 +00:00
Thomas Meckel 0b4fe10c8f
🐛 Fix empty reponse body when default `status_code` is empty but the a `Response` parameter with `response.status_code` is set (#5360)
Co-authored-by: Thomas Meckel <tmeckel@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-08 15:02:59 +00:00
DCsunset 3ec498af63
Add support in `jsonable_encoder` for include and exclude with dataclasses (#4923)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-08 16:29:23 +02:00
Sebastián Ramírez 3079ba925e 🔖 Release version 0.82.0 2022-09-04 21:26:31 +02:00
Adrian Garcia Badaracco f8460a8b54
🐛 Allow exit code for dependencies with `yield` to always execute, by removing capacity limiter for them, to e.g. allow closing DB connections without deadlocks (#5122)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-04 21:09:24 +02:00
Mateusz Nowak dacb689290
Export `WebSocketState` in `fastapi.websockets` (#4376) 2022-09-04 17:12:10 +02:00
Charlie DiGiovanna 56f887de15
🐛 Make sure a parameter defined as required is kept required in OpenAPI even if defined as optional in another dependency (#4319)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-03 17:12:41 +00:00
Junghoon Yang 52b5b08910
♻ Internal small refactor, move `operation_id` parameter position in delete method for consistency with the code (#4474)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-02 13:36:00 +00:00
Marcelo Trylesinski 30b3905ef3
Support Python internal description on Pydantic model's docstring (#3032)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-02 14:43:21 +02:00
abc.zxy 7250c194da
Update `ORJSONResponse` to support non `str` keys and serializing Numpy arrays (#3892)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-09-02 10:17:31 +00:00
David Brochart d8b6aa630c
🐛 Fix support for path parameters in WebSockets (#3879)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-01 10:50:47 +02:00
Sebastián Ramírez 0bb8920ae1 🔖 Release version 0.81.0 2022-08-26 17:18:44 +02:00
Luis R 22bed0008c
🐛 Fix `jsonable_encoder` for dataclasses with pydantic-compatible fields (#3607)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-26 15:56:47 +02:00
Erik Vroon de6ccd7754
Add ReDoc `<noscript>` warning when JS is disabled (#5074)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 13:56:07 +00:00
pylounge dc10b81d05
♻ Simplify internal RegEx in `fastapi/utils.py` (#5057)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-26 15:46:22 +02:00
David Kim 0539dd9cd3
🔧 Fix Type hint of `auto_error` which does not need to be `Optional[bool]` (#4933) 2022-08-26 15:29:50 +02:00
Shahriyar Rzayev 00bdf533ef
♻ Change a `dict()` for `{}` in `fastapi/utils.py` (#3138) 2022-08-26 15:23:25 +02:00
Guillermo Quintana Pelayo a64387c3fc
♻ Move internal variable for errors in `jsonable_encoder` to put related code closer (#4560)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 13:16:44 +00:00
Muzaffer Cikay c8124496fc
♻ Simplify conditional assignment in `fastapi/dependencies/utils.py` (#4597)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 13:16:17 +00:00
Ori Levari 880c8b37cf
🐛 Fix support for extending `openapi_extras` with parameter lists (#4267)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 09:26:20 +00:00
juntatalor ca2fae0588
Add support for `FrozenSet` in parameters (e.g. query) (#2938)
Co-authored-by: saborisov <borisov_s@tass.ru>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-25 23:52:53 +02:00
Andy Challis eb3ab337ab
Allow custom middlewares to raise `HTTPException`s and propagate them (#2036)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-25 23:44:40 +02:00
Sidharth Ajithkumar 9359a8d65f
Preserve `json.JSONDecodeError` information when handling invalid JSON in request body, to support custom exception handlers that use its information (#4057)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-25 11:55:53 +02:00
Sebastián Ramírez 7d6e70791d 🔖 Release version 0.80.0 2022-08-23 16:14:48 +02:00
Teo Koon Peng ec072d75fe
⬆ Upgrade Swagger UI copy of `oauth2-redirect.html` to include fixes for flavors of authorization code flows in Swagger UI (#3439)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-23 13:57:25 +00:00
Andrey Semakin f6808e76dc
♻ Strip empty whitespace from description extracted from docstrings (#2821)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-23 13:47:19 +00:00
laggardkernel b993b4af28
🐛 Fix cached dependencies when using a dependency in `Security()` and other places (e.g. `Depends()`) with different OAuth2 scopes (#2945)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-23 13:30:24 +00:00
Taneli Hukkinen 634cf22584
🐛 Fix `response_model` not invalidating `None` (#2725)
Co-authored-by: Taneli Hukkinen <hukkinj1@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-22 19:17:45 +00:00
Sebastián Ramírez e7b1b96a54
🎨 Update type annotations for `response_model`, allow things like `Union[str, None]` (#5294) 2022-08-22 18:49:03 +00:00
Sebastián Ramírez ab8988ff7c 🔖 Release version 0.79.1 2022-08-18 23:14:07 +02:00
Xavi Moreno eb2e183361
🐛 Fix `jsonable_encoder` using `include` and `exclude` parameters for non-Pydantic objects (#2606)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-18 22:48:21 +02:00
Luca Repetti e88089ec21
🐛 Fix edge case with repeated aliases names not shown in OpenAPI (#2351)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-18 20:31:19 +00:00
Sebastián Ramírez 50fb34bf55 🔖 Release version 0.79.0 2022-07-14 19:35:13 +02:00
Sebastián Ramírez c43120258f
🐛 Fix removing body from status codes that do not support it (#5145) 2022-07-14 13:19:42 +02:00
Sebastián Ramírez 1876ebc779 🔖 Release version 0.78.0 2022-05-14 14:58:04 -05:00
Sebastián Ramírez 9262fa8362
Add support for not needing `...` as default value in required Query(), Path(), Header(), etc. (#4906)
*  Do not require default value in Query(), Path(), Header(), etc

* 📝 Update source examples for docs with default and required values

*  Update tests with new default values and not required Ellipsis

* 📝 Update docs for Query params and update info about default value, required, Ellipsis
2022-05-13 18:38:22 -05:00
Shahriyar Rzayev 82775f7cd0
♻ Refactor dict value extraction to minimize key lookups `fastapi/utils.py` (#3139)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-12 20:38:30 +00:00
Sebastián Ramírez 9cae3cdb09
🔧 Add Python formatting hooks to pre-commit (#4890) 2022-05-12 00:41:06 +00:00
Sebastián Ramírez 2aaac141dd 🔖 Release version 0.77.1 2022-05-09 23:19:32 -05:00
Marcelo Trylesinski f396912043
⬆ Upgrade Starlette from 0.19.0 to 0.19.1 (#4819)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 03:22:26 +00:00
Sebastián Ramírez 0696454445 🔖 Release version 0.77.0 2022-05-09 20:40:03 -05:00
Marcelo Trylesinski 86fa3cb24f
⬆ Upgrade Starlette from 0.18.0 to 0.19.0 (#4488)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-09 13:06:42 -05:00
Sebastián Ramírez 9090c771ee 🔖 Release version 0.76.0 2022-05-05 17:26:05 -05:00
Marcelo Trylesinski 33d61430cf
⬆ Upgrade Starlette from 0.17.1 to 0.18.0 (#4483)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-05 17:19:59 -05:00
Sebastián Ramírez 2b54432a9c 🔖 Release version 0.75.2 2022-04-17 23:08:37 +02:00
dconathan c449ae5c74
🐛 Fix JSON Schema for `ValidationError` at field `loc` (#3810)
Co-authored-by: Devin Conathan <dconatha@amfam.com>
2022-04-17 19:41:46 +02:00
Marcelo Trylesinski d81c908132
🐛 Fix support for prefix on APIRouter WebSockets (#2640)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-04-17 19:21:53 +02:00
Alan Wright acf8a91c25
⬆ Upgrade Swagger UI - swagger-ui-dist@4 (#4347)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-04-17 14:47:14 +00:00
Sebastián Ramírez 26f725d259 🔖 Release version 0.75.1 2022-04-01 18:05:52 -05:00
Sebastián Ramírez 19769d0483 🔖 Release version 0.75.0 2022-03-04 23:09:11 +01:00