Skip to content

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

@aderende
Copy link
Author

aderende commented Jul 4, 2024

@msivasubramaniaan fixed! Could you, please, take a look?

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.

2 participants