ostrowr / ts-json-validator

Let JSON play nicely with Typescript
MIT License
342 stars 7 forks source link

In error JSON, dataPath field prefixed by a full stop (period) #18

Closed gavin-grypp closed 4 years ago

gavin-grypp commented 4 years ago

While testing using the sample JSON and schema given at https://json-schema.org/learn/getting-started-step-by-step.html and deliberately changing 'productId' in the JSON from an integer value to a string to get an error returned, I noticed that the value associated with dataPath was prefixed with a full stop (American: period, i.e. a dot):

"dataPath": ".productId"

I believe that this should not be the case.

I presume this have been processed from ajv output, the error message of which starts "data.productId".

gavin-grypp commented 4 years ago

Just realised that the issue is present in ajv, so closing this and filing upstream.