-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decouple schema validation from core #2693
Comments
Yes. I mentioned the possibility of a pluggable validator in #1464 (comment) as a means of sidestepping the need for |
@epicfaace @bollwyvl We are experiencing the |
@heath-freenome earlier PR: #1286 |
As it turns out, the new In a long-lived branch:
|
Suggested changes:
|
Fixed in the v5 beta, see the 5.x migration guide |
This is really exciting stuff, I've had to monkey patch the global AJV instance in the past to make use of additional ajv key words. I'll be able to remove that code :) |
Hello there, I upgraded Could you kindly clarify for me whether the Thank you |
Does it happen when you use the @rjsf/validator-ajv8?
…On Wed, Oct 19, 2022 at 6:30 PM Aziz F Dagli ***@***.***> wrote:
Hello there, I upgraded rjsf/core to 5.0.0-beta.9
<https://github.com/rjsf-team/react-jsonschema-form/releases/tag/5.0.0-beta.9>.
Still I need to add unsafe-eval for validation otherwise I am getting
this error. #1973
<#1973>
Could you kindly clarify for me whether the rjsf/core form requires the
unsafe-eval CSP?
Thank you
—
Reply to this email directly, view it on GitHub
<#2693 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMKJCZGFJ4RVBRYGRL5MAILWECOELANCNFSM5N2WP74A>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
--
This e-mail is private and confidential and is for the addressee only. If
misdirected, please notify us by telephone, confirming that it has been
deleted from your system and any hard copies destroyed. You are strictly
prohibited from using, printing, distributing or disseminating it or any
information contained in it save to the intended recipient.
|
@heath-freenome thank you for your reply. Yes, I tested both
|
@heath-freenome @afd57 as i understand, ajv will not fix CSP i did this
so i go something like this in validat_schema.js
i am not clear on how to use this function to do the validation, thank you for the help |
Prerequisites
Description
ajv@6
has served this project well. The6.*
line (and indeed the7.*
line #2542) have reached end-of-life, and if new serious issues were discovered, may not be fixed. With the success of the decoupled, but co-maintained, themes it is perhaps time to consider co-developing multiple schema validators that meet different needs.While client-side validation is an important part of the rjsf experience, and should be encouraged with a sensible default, picking a validator carries a number of trade-offs:
ajv@8
dropsdraft4
)For example,
ajv@>7
makes pre-compiled standalone validators possible, which can be tree-shaken to avoid bringing the compilerProposal
validate.js
to aAJV6Validator
classValidationError
to which anAjvError
can be converted@rjsf/validator-ajv6
NoOpValidator
@rjsf/validator-base
package, as a dependency of@rjsf/core
@rjsf/validator-ajv8
to track featuresvalidateFormData
to the form props, somewhat like Injection of custom ajv instance via prop (+ removal of global ajv) #1286, and, depending on when it lands:@rjsf/core 3.*
AJV6Validator.validateFormData
default@rjsf/core 4.*
peerDependency
on@rjsf/validator-ajv8
AJV8Validator.validateFormData
NoOpValidator
console.warn
Once the existing behavior and test suite have been
The text was updated successfully, but these errors were encountered: