You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importAjvfrom"ajv";exportclassJsonValidationHelper{enumStyleParameters{BACKGROUND_COLOR='backgroundcolor'// many more}privatestaticJsonValidationHelper<T>(typeProperties: object,schema: JSONSchema){constresult=SchemaParser.ajv.validate(schema,typeProperties)returntypeProperties;}}
Validation result, data AFTER validation, error messages
What results did you expect?
Since removeAdditional is set to true in the options and additionalProperties are not allowed, all properties not defined in the schema should be removed and since there are no required properties set the validation result should always be true.
In short:
The validation result should be true.
property CHEESE schould have been removed from the data Are you going to resolve the issue?
The text was updated successfully, but these errors were encountered:
As this does not seem to be a TS issue, can you provide a working example that doesn't use TypeScript and is as simple as you can make it. For example, rather than having ...Object.keys(StyleParameters) you should just write the schema as a simple object literal.
What version of Ajv are you using? Does the issue happen if you use the latest version?
8.17.1
Ajv options object
JSON Schema
Sample data
Your code
Validation result, data AFTER validation, error messages
What results did you expect?
Since removeAdditional is set to true in the options and additionalProperties are not allowed, all properties not defined in the schema should be removed and since there are no required properties set the validation result should always be true.
In short:
Are you going to resolve the issue?
The text was updated successfully, but these errors were encountered: