Commit 4c44017
committed
[FIX] fastapi: support both starlette < and >=
Starting from `starlette >= 0.48`, the `status.HTTP_422_UNPROCESSABLE_ENTITY`
emits a deprecation warning, as it has been replaced by
`status.HTTP_422_UNPROCESSABLE_CONTENT`.
To be compatible with past and future versions, we simply use the integer value
`422`, aligning also with the updated `fastapi` documentation:
See:
- fastapi/fastapi#140770.48
1 parent e8d767d commit 4c44017
2 files changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | | - | |
161 | | - | |
| 159 | + | |
162 | 160 | | |
163 | 161 | | |
164 | 162 | | |
| |||
0 commit comments