gregsdennis/Manatee.Json

Error messages for additional properties

lmenzel opened this issue · 5 comments

More specific error messages for additional properties that are not allowed would be nice.

At the moment I get only "Properties not covered by properties and patternProperties are not allowed." and not hint, which properties, if I have a schema with "additionalProperties": false and add properties to my json.

I would expect something like: "Property 'xyz' has not been defined and the schema does not allow additional properties." for every additional property.

What output format are you using?

I tried every format, including verbose and detailed, but I didn't get an information which property. Normally we use basic.

Hm.... It looks like the expectation with that keyword was that the nested results would give you insight into which properties were invalid. However for the specific case of false, it shorcuts and just outputs the error message.

It seems I need to make two updates:

  1. Add the list of offending properties to the AdditionalInfo property on the result object
  2. Incorporate those into the error messages (I have separate ones for false and a specified schema).

Thanks for the report.

This will apply to additionalItems, unevaluatedProperties, and unevaluatedItems as well.

Please see v12.3.0 for the fix.