Commit d3a2fba
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 c75f17d commit d3a2fba
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 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | 99 | | |
114 | 100 | | |
115 | 101 | | |
| |||
326 | 312 | | |
327 | 313 | | |
328 | 314 | | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
334 | 318 | | |
335 | 319 | | |
336 | 320 | | |
| |||
0 commit comments