resolveSchema = (context, schema,
    { stack = 0, resolveFor = CONVERSION, seenRef = {}, isResponseSchema = false } = {}
  ) => {
    // reset readOnly and writeOnly prop cache before resolving schema to make sure we have fresh cache
    resetReadWritePropCache(context);

    let resolvedSchema = _resolveSchema(context, schema, stack, resolveFor, seenRef);

    /**
     * If readOnly or writeOnly properties are present in the schema, we need to clone original schema first.
     * Because we modify original resolved schema and delete readOnly or writeOnly properties from it
     * depending upon if schema belongs to Request or Response.
     * This is done to avoid modifying original schema object and to keep it intact for future use.
     */
    if (!_.isEmpty(context.readOnlyPropCache) || !_.isEmpty(context.writeOnlyPropCache)) {
      resolvedSchema = _.cloneDeep(resolvedSchema);
    }

    if (isResponseSchema) {
      _.forOwn(context.writeOnlyPropCache, (value, key) => {
        // We need to make sure to remove empty strings via _.compact that are added while forming json-pointer
        _.unset(resolvedSchema, utils.getJsonPathArray(key));
      });
    }
    else {
      _.forOwn(context.readOnlyPropCache, (value, key) => {
        // We need to make sure to remove empty strings via _.compact that are added while forming json-pointer
        _.unset(resolvedSchema, utils.getJsonPathArray(key));
      });
    }

    return resolvedSchema;
  }
Wrapper around _resolveSchema which resolves a given schema

@param {Object} context - Global context
@param {Object} schema - Schema that is to be resolved
@param {Object} resolutionMeta - Metadata of resolution taking place
@param {Number} resolutionMeta.stack - Current recursion depth
@param {String} resolutionMeta.resolveFor - For which action this resolution is to be done
@param {Object} resolutionMeta.seenRef - Map of all the references that have been resolved
@param {Boolean} resolutionMeta.isResponseSchema - Whether schema is from response or not

@returns {Object} Returns the object that satisfies the schema