Commit 1280bd3
Christian Hattemer
Allow to keep the types as they were and just add a default value
It's still possible to omit all unchanged fields in PATCH requests, but
for fields that are given Pydantic will reject data that specifies an
explicit null for fields that aren't optional in the full model.
This is useful when using the package with SQLModel. Without this
feature the client could try to assign a NULL value to a column with a
NOT NULL constraint, which would raise an IntegrityError.1 parent a39b984 commit 1280bd3
1 file changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
107 | 115 | | |
108 | | - | |
| 116 | + | |
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
| |||
0 commit comments