Commit 869d375
committed
Compare objects MRO with encoders at runtime
The previous implementation doesn't handle subclass instances when
pydantic.json.ENCODERS_BY_TYPE is modified after fastapi.encoders import.
This diff makes it easier for developers to add custom encoders that also work
with subclass instances (and it simplifies the code, as well).1 parent 53d2453 commit 869d375
1 file changed
+4
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | 97 | | |
112 | 98 | | |
113 | 99 | | |
| |||
313 | 299 | | |
314 | 300 | | |
315 | 301 | | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
321 | 305 | | |
322 | 306 | | |
323 | 307 | | |
| |||
0 commit comments