Commit 16a1bd4
committed
fix(objectschema)!: omit id from schema returned by without + only
the methods without and only return new schema objects with the same id
that was found on the original. In terms of schema reuse, this creates
two different schemas with the same id which is technically invalid.
Additionally, it was not possible to set the id property on an object
schema that had properties defined. This problem originates from the
setattribute function which will always set the attribute on the
schema properties if they are defined. In the case of the object schema,
this is almost always the case. This changes the id function on the
object schema to always generate a new schema with the id set on the
object schema rather than its properties
BREAKING CHANGE: ObjectSchema.id() will always set the id on the root object
BREAKING CHANGE: ObjectSchema.without() will omit id from the return schema
BREAKING CHANGE: ObjectSchema.only() will omit id from the return schema1 parent f62a218 commit 16a1bd4
4 files changed
+64
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
228 | 234 | | |
229 | 235 | | |
230 | 236 | | |
| |||
276 | 282 | | |
277 | 283 | | |
278 | 284 | | |
279 | | - | |
| 285 | + | |
| 286 | + | |
280 | 287 | | |
281 | 288 | | |
282 | | - | |
| 289 | + | |
| 290 | + | |
283 | 291 | | |
284 | 292 | | |
285 | 293 | | |
| |||
951 | 959 | | |
952 | 960 | | |
953 | 961 | | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
954 | 977 | | |
955 | 978 | | |
956 | 979 | | |
| |||
1086 | 1109 | | |
1087 | 1110 | | |
1088 | 1111 | | |
1089 | | - | |
| 1112 | + | |
| 1113 | + | |
1090 | 1114 | | |
1091 | 1115 | | |
1092 | 1116 | | |
| |||
1097 | 1121 | | |
1098 | 1122 | | |
1099 | 1123 | | |
1100 | | - | |
| 1124 | + | |
| 1125 | + | |
1101 | 1126 | | |
1102 | 1127 | | |
1103 | 1128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
39 | 54 | | |
40 | 55 | | |
41 | 56 | | |
| |||
335 | 350 | | |
336 | 351 | | |
337 | 352 | | |
338 | | - | |
| 353 | + | |
| 354 | + | |
339 | 355 | | |
340 | 356 | | |
341 | 357 | | |
342 | 358 | | |
343 | 359 | | |
344 | 360 | | |
345 | 361 | | |
346 | | - | |
| 362 | + | |
347 | 363 | | |
348 | 364 | | |
349 | 365 | | |
| |||
352 | 368 | | |
353 | 369 | | |
354 | 370 | | |
355 | | - | |
| 371 | + | |
| 372 | + | |
356 | 373 | | |
357 | 374 | | |
358 | 375 | | |
359 | 376 | | |
360 | 377 | | |
361 | 378 | | |
362 | 379 | | |
363 | | - | |
| 380 | + | |
364 | 381 | | |
365 | 382 | | |
366 | 383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
96 | 105 | | |
97 | 106 | | |
98 | 107 | | |
| |||
213 | 222 | | |
214 | 223 | | |
215 | 224 | | |
216 | | - | |
217 | 225 | | |
218 | 226 | | |
219 | 227 | | |
220 | 228 | | |
221 | | - | |
| 229 | + | |
222 | 230 | | |
223 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
224 | 234 | | |
225 | 235 | | |
226 | 236 | | |
| |||
915 | 925 | | |
916 | 926 | | |
917 | 927 | | |
918 | | - | |
919 | 928 | | |
920 | 929 | | |
921 | 930 | | |
| |||
939 | 948 | | |
940 | 949 | | |
941 | 950 | | |
942 | | - | |
943 | 951 | | |
944 | 952 | | |
945 | 953 | | |
| |||
974 | 982 | | |
975 | 983 | | |
976 | 984 | | |
977 | | - | |
978 | 985 | | |
979 | 986 | | |
980 | 987 | | |
| |||
1001 | 1008 | | |
1002 | 1009 | | |
1003 | 1010 | | |
1004 | | - | |
1005 | 1011 | | |
1006 | 1012 | | |
1007 | 1013 | | |
| |||
0 commit comments