meteor / validation-error

Standardized validation error format for Meteor
https://atmospherejs.com/mdg/validation-error
Other
12 stars 4 forks source link

It looks like arbitrary key/value pairs are not supported in the array passed to ValidationError #17

Closed jamauro closed 1 year ago

jamauro commented 1 year ago

When I attempt to pass in other data to the ValidationError, I'm seeing a check failure:

Match error: Unknown key in field [0].message
throw new ValidationError([{name: 'test', type: 'invalid type', message: 'testing'}]);

What's weird is that I thought I had seen this work properly previously.

jamauro commented 1 year ago

Oh I think I figured it out. You need to pass in a details object alongside name and type. That object can contain arbitrary key value pairs. Will submit an update to the documentation.