import { Ajv } from "ajv" ; import { JSONSchema6 } from "json-schema" ; import { default as ResolveLib , getDataKeys } from "../libs/resolve" ; const itemsName = "items" ; param { JSONSchema6 } schema param { String } schemaKey param { Ajv } ajv return { JSONSchema6 } export default ( schema , schemaKey , ajv ) => { let { items } = schema ; if ( items ) { const propertySchemaResolve = new ResolveLib ( ajv , items as JSONSchema6 , [ schemaKey , itemsName ] . join ( "/" ) ) , keys = getDataKeys ( [ schemaKey , itemsName ] . join ( "/" ) ) ; Object . assign ( propertySchemaResolve . mergeSchema , { keys } ) ; } return schema ; } ;