@travetto/schema 8.0.0-alpha.24 → 8.0.0-alpha.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -129,6 +129,12 @@ function combineClassWithParent<T extends SchemaClassConfig>(base: T, parent: T)
|
|
|
129
129
|
break;
|
|
130
130
|
}
|
|
131
131
|
default: {
|
|
132
|
+
for (const [key, field] of Object.entries(base.fields)) {
|
|
133
|
+
const parentField = parent.fields[key];
|
|
134
|
+
if (parentField?.required?.active && field.required?.active === false) {
|
|
135
|
+
throw new RuntimeError(`Cannot widen required field '${key}' to optional in sub-class ${base.class.name}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
132
138
|
base.fields = { ...parent.fields, ...base.fields };
|
|
133
139
|
}
|
|
134
140
|
}
|