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.
Duplicate of https://github.com/redhat-developer/yaml-language-server/pull/967, fixed CI build
What does this PR do?
It adds
skipSchemaValidation
settings to enable/disable JSON schema validation.By default,
skipSchemaValidation
isfalse
, but if the integrator always calls configure withskipSchemaValidation = true
, then the codeschema07Validator = ajv.compile(jsonSchema07)
will never get called. This allows the browser to avoid adding theunsafe-eval
policy directive.What issues does this PR fix or reference?
The ajv.compile(...) function requires the
unsafe-eval
policy directive for thescript-src
policy. https://github.com/eclipsesource/jsonforms/issues/1498The
skipSchemaValidation
setting allows the application to avoid compiling the schema validator and prevents the need to use theunsafe-eval
policy.Is it tested? How?
A test case with
skipSchemaValidation
enabled has been added.