@rjsf/validator-ajv8
Advanced tools
Comparing version 5.14.2 to 5.14.3
@@ -19,3 +19,7 @@ import standaloneCode from 'ajv/dist/standalone'; | ||
// Allow users to turn off the `lines: true` feature in their own overrides, but NOT the `source: true` | ||
const compileOptions = Object.assign(Object.assign({}, ajvOptionsOverrides), { code: Object.assign(Object.assign({ lines: true }, ajvOptionsOverrides.code), { source: true }), schemas }); | ||
const compileOptions = { | ||
...ajvOptionsOverrides, | ||
code: { lines: true, ...ajvOptionsOverrides.code, source: true }, | ||
schemas, | ||
}; | ||
const ajv = createAjvInstance(additionalMetaSchemas, customFormats, compileOptions, ajvFormatOptions, AjvClass); | ||
@@ -22,0 +26,0 @@ return standaloneCode(ajv); |
@@ -29,3 +29,3 @@ import Ajv from 'ajv'; | ||
export default function createAjvInstance(additionalMetaSchemas, customFormats, ajvOptionsOverrides = {}, ajvFormatOptions, AjvClass = Ajv) { | ||
const ajv = new AjvClass(Object.assign(Object.assign({}, AJV_CONFIG), ajvOptionsOverrides)); | ||
const ajv = new AjvClass({ ...AJV_CONFIG, ...ajvOptionsOverrides }); | ||
if (ajvFormatOptions) { | ||
@@ -32,0 +32,0 @@ addFormats(ajv, ajvFormatOptions); |
@@ -1,2 +0,1 @@ | ||
import { __rest } from "tslib"; | ||
import get from 'lodash/get'; | ||
@@ -12,3 +11,3 @@ import { createErrorHandler, getDefaultFormState, getUiOptions, PROPERTIES_KEY, toErrorSchema, unwrapErrorHandler, validationDataMerge, } from '@rjsf/utils'; | ||
return errors.map((e) => { | ||
const { instancePath, keyword, params, schemaPath, parentSchema } = e, rest = __rest(e, ["instancePath", "keyword", "params", "schemaPath", "parentSchema"]); | ||
const { instancePath, keyword, params, schemaPath, parentSchema, ...rest } = e; | ||
let { message = '' } = rest; | ||
@@ -79,5 +78,8 @@ let property = instancePath.replace(/\//g, '.'); | ||
if (invalidSchemaError) { | ||
errorSchema = Object.assign(Object.assign({}, errorSchema), { $schema: { | ||
errorSchema = { | ||
...errorSchema, | ||
$schema: { | ||
__errors: [invalidSchemaError.message], | ||
} }); | ||
}, | ||
}; | ||
} | ||
@@ -84,0 +86,0 @@ if (typeof customValidate !== 'function') { |
{ | ||
"name": "@rjsf/validator-ajv8", | ||
"version": "5.14.2", | ||
"version": "5.14.3", | ||
"main": "dist/index.js", | ||
@@ -51,3 +51,3 @@ "module": "lib/index.js", | ||
"@babel/preset-typescript": "^7.22.15", | ||
"@rjsf/utils": "^5.14.2", | ||
"@rjsf/utils": "^5.14.3", | ||
"@types/jest": "^29.5.7", | ||
@@ -86,3 +86,3 @@ "@types/json-schema": "^7.0.12", | ||
"license": "Apache-2.0", | ||
"gitHead": "8093e210f5ad9373b68e54dfc22df1962c2948e4" | ||
"gitHead": "cc96dee0be20d873a00ec00d1f7d033d4b9c9058" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2621
313484