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

Added language setting option to skip runtime schema compilation #967

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aderende
Copy link

@aderende aderende commented May 7, 2024

What does this PR do?

It adds skipSchemaValidation settings to enable/disable JSON schema validation.

By default, skipSchemaValidation is false, but if the integrator always calls configure with skipSchemaValidation = true, then the code schema07Validator = ajv.compile(jsonSchema07) will never get called. This allows the browser to avoid adding the unsafe-eval policy directive.

What issues does this PR fix or reference?

The ajv.compile(...) function requires the unsafe-eval policy directive for the script-src policy. eclipsesource/jsonforms#1498

The skipSchemaValidation setting allows the application to avoid compiling the schema validator and prevents the need to use the unsafe-eval policy.

Is it tested? How?

A test case with skipSchemaValidation enabled has been added.

@msivasubramaniaan
Copy link
Contributor

@aderende please fix the build issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants