Closed thoroc closed 2 months ago
Additionally I could remove the properties on the _schema
for which the value is undefined
but that seems to be more of a bug than a feature:
const properties = AjvTruckSchema['_schema'].properties;
// remove
Object.keys(properties['_schema'].properties).forEach((key) => {
if (properties[key] === undefined) {
delete properties[key];
}
});
To add some more context. I have 2 scenarios where I can see the type
and properties
as unknown
:
union
, but only the first schema seems to be then affected (see the Transport schema)@thoroc the issue will be fixed on next release
Excellent thank you
Describe the bug I was just trying this as an alternative to Zod, but the merge schema method isn't working in like for like fashion. Am I missing something?
To Reproduce Clone the repo at https://github.com/thoroc/zod-is-dead
Expected behavior All test passess
Desktop (please complete the following information):
Additional context I have put some log output to see what's the object on the Ajv truck in the example and this is what I get:
Vehicle Schema
Truck Schema
Truck instance
AjvTruckSchema.schema