Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@rjsf/validator-ajv6
Advanced tools
AJV-6 based validator plugin for react-jsonschema-form
.
Explore the docs »
View Playground
·
Report Bug
·
Request Feature
Exports validator-ajv6
plugin for react-jsonschema-form
.
NOTE: This package is deprecated in favor of the
@rjsf/validator-ajv8
and is provided primarily for people upgrading to version 5 who initially want to minimize the validator differences.
@rjsf/utils >= 5.0.0
yarn add @rjsf/core
yarn add @rjsf/validator-ajv6
import { RJSFSchema } from '@rjsf/utils';
import Form from '@rjsf/core';
import validator from '@rjsf/validator-ajv6';
const schema: RJSFSchema = {
type: 'string',
};
<Form schema={schema} validator={validator} />;
or, using a more complex example using custom validator with custom formats
import { RJSFSchema } from '@rjsf/utils';
import Form from '@rjsf/core';
import { customizeValidator } from '@rjsf/validator-ajv6';
const customFormats = {
'phone-us': /\(?\d{3}\)?[\s-]?\d{3}[\s-]?\d{4}$/,
};
const validator = customizeValidator({
customFormats,
});
const schema: RJSFSchema = {
type: 'string',
format: 'phone-us',
};
<Form schema={schema} validator={validator} />;
or, using a more complex example using a custom with additional meta schema
import { RJSFSchema } from '@rjsf/utils';
import Form from '@rjsf/core';
import { customizeValidator } from '@rjsf/validator-ajv6';
const metaSchemaDraft04 = require('ajv/lib/refs/json-schema-draft-04.json');
const validator = customizeValidator({
additionalMetaSchemas: [metaSchemaDraft04],
});
const schema: RJSFSchema = {
$schema: 'http://json-schema.org/draft-04/schema#',
type: 'string',
};
<Form schema={schema} validator={validator} />;
or, using a more complex example using custom validator config override options
import { RJSFSchema } from '@rjsf/utils';
import Form from '@rjsf/core';
import { customizeValidator } from '@rjsf/validator-ajv6';
const validator = customizeValidator({
ajvOptionsOverrides: {
$data: true,
verbose: true,
},
});
const schema: RJSFSchema = {
type: 'string',
};
<Form schema={schema} validator={validator} />;
Finally, you can combine both additional meta schemas, custom formats and custom validator config override options.
import { RJSFSchema } from '@rjsf/utils';
import Form from '@rjsf/core';
import { customizeValidator } from '@rjsf/validator-ajv6';
const metaSchemaDraft04 = require('ajv/lib/refs/json-schema-draft-04.json');
const customFormats = {
'phone-us': /\(?\d{3}\)?[\s-]?\d{3}[\s-]?\d{4}$/,
};
const validator = customizeValidator({
additionalMetaSchemas: [metaSchemaDraft04],
customFormats,
ajvOptionsOverrides: {
$data: true,
verbose: true,
},
});
const schema: RJSFSchema = {
$schema: 'http://json-schema.org/draft-04/schema#',
type: 'string',
format: 'phone-us',
};
<Form schema={schema} validator={validator} />;
See the open issues for a list of proposed features (and known issues).
Read our contributors' guide to get started.
rjsf team: https://github.com/orgs/rjsf-team/people
GitHub repository: https://github.com/rjsf-team/react-jsonschema-form
5.24.0
lodash.isEqual()
to @rjsf/utils.deepEquals
.title
or ui:title
. This fix only applicable if we use an ajv-i18n localizer. Ref. #4402.lodash.isEqual()
to @rjsf/utils.deepEquals
at precompiledValidator.FAQs
The ajv-6 based validator for @rjsf/core
The npm package @rjsf/validator-ajv6 receives a total of 6,663 weekly downloads. As such, @rjsf/validator-ajv6 popularity was classified as popular.
We found that @rjsf/validator-ajv6 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.