Open danthegoodman1 opened 1 year ago
eIt seems as if the required value resolved is not firing when mixing required and non-required values:
export function mergeSchemas(schemas: any[]) { return mergeAllOf({ allOf: schemas, }, { resolvers: { type: (values) => { const finalType = [] for (const value of values) { if (Array.isArray(value)) { finalType.push(...value) } else { finalType.push(value) } } return finalType as any }, required: (values) => { console.log("required resolver", values) return false } } }) } console.log(mergeSchemas([ { "type": "object", "properties": { "hey": { "type": "string", "required": true }, "this": { "type": "number", "required": true }, "is": { "type": "array", "items": { "type": "string", "required": true }, "required": true } }, "required": true }, { "type": "object", "properties": { "hey": { "type": "string" }, "this": { "type": "number" }, "is": { "type": "array", "items": { "type": "string" } } } }]))
Outputs:
{ type: 'object', required: true, properties: { hey: { type: 'string', required: true }, this: { type: 'number', required: true }, is: { type: 'array', required: true, items: [Object] } } }
notice that:
required resolver
eIt seems as if the required value resolved is not firing when mixing required and non-required values:
Outputs:
notice that:
required resolver
line