data icon indicating copy to clipboard operation
data copied to clipboard

The "better-ajv-errors" package fails to report a schema error

Open escattone opened this issue 5 years ago • 0 comments

When linting https://github.com/mdn/data/blob/master/css/at-rules.json, a schema error was detected for the @property object (https://github.com/mdn/data/blob/3a92ce8348e83a0ce7beef84b45accf151645f92/css/at-rules.json#L331):

  "@property": {
    "syntax": "@property <custom-property-name> {\n  <declaration-list>\n}",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@property"
  },

because it was missing the groups property per https://github.com/mdn/data/blob/3a92ce8348e83a0ce7beef84b45accf151645f92/css/at-rules.schema.json#L39 Although the error output reports JSON Schema – 1 error(s), the detailed error message is blank:

...
css/at-rules.json
  Style – OK
  JSON Schema – 1 error(s)



css/at-rules.schema.json
  Style – OK
...

This seems to be a problem in the better-ajv-errors npm package.

NOTE (to self): The value of ajv.errors at https://github.com/mdn/data/blob/3a92ce8348e83a0ce7beef84b45accf151645f92/test/lint.js#L75 was:

[
  {
    keyword: 'required',
    dataPath: '/@property',
    schemaPath: '#/additionalProperties/required',
    params: { missingProperty: 'groups' },
    message: "should have required property 'groups'"
  }
]

escattone avatar Nov 10 '20 23:11 escattone