Skip to content
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

Could ajv be *optionally* swapped with @cfworker/json-schema? #3269

Open
1 task done
fregante opened this issue Dec 2, 2022 · 6 comments
Open
1 task done

Could ajv be *optionally* swapped with @cfworker/json-schema? #3269

fregante opened this issue Dec 2, 2022 · 6 comments
Labels
feature Is a feature request help wanted

Comments

@fregante
Copy link
Contributor

fregante commented Dec 2, 2022

Prerequisites

What theme are you using?

bootstrap-4

Is your feature request related to a problem? Please describe.

The issue is that I can't use RJSF in a context that disallows unsafe-eval, as described a few times before.

Describe the solution you'd like

Could RJSF offer validation based on @cfworker/json-schema, for example? I noticed that was made in the v5 branch towards this goal:

This could be offered as an alternative to the built-in ajv-based validation

Describe alternatives you've considered

No response

@fregante fregante added feature Is a feature request needs triage Initial label given, to be assigned correct labels and assigned labels Dec 2, 2022
@fregante fregante changed the title Could ajv be *optionally* be swapped with @cfworker/json-schema? Could ajv be *optionally* swapped with @cfworker/json-schema? Dec 3, 2022
@heath-freenome
Copy link
Member

heath-freenome commented Dec 8, 2022

@fregante Does this still occur with the avj8 validator provided in the beta? Also, one definitely CAN build a validator implementation that uses @cfworker/json-schema. As a small team of volunteers we don't have the bandwidth to build it ourselves, but we would definitely consider adding it to the repo if someone else were to build it and it passes all of the tests with the utils and core libraries. Can we sign you up? :)

@heath-freenome heath-freenome added help wanted and removed needs triage Initial label given, to be assigned correct labels and assigned labels Dec 8, 2022
@fregante
Copy link
Contributor Author

fregante commented Dec 8, 2022

According to this issue, v8 still uses unsafe evaluation, so the issue still exists: ajv-validator/ajv#1830

@heath-freenome
Copy link
Member

According to this issue, v8 still uses unsafe evaluation, so the issue still exists: ajv-validator/ajv#1830

Lovely... Are you interested in building a validator for @rjsf that uses @cfworker/json-schema?

@joeyJsonar
Copy link

We definitely need a custom validator at this point. We cannot precomile as our forms are themselves form so dynamically from an api, so cannot precompile. @heath-freenome

@alfonsoar
Copy link
Member

@joeyJsonar @fregante did you ever find a path forward? I'm considering contributing a validator that uses @cfworker/json-schema.

Dynamic pre-compiling is not an option since we need to do this all on the client side.

@fregante
Copy link
Contributor Author

fregante commented Aug 2, 2024

@alfonsoar I wasn't the one who worked on this in the end. Apparently it was done in pixiebrix/pixiebrix-extension#7081 but I have no knowledge of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is a feature request help wanted
Projects
None yet
Development

No branches or pull requests

4 participants