santhosh-tekuri / jsonschema

JSONSchema (draft 2020-12, draft 2019-09, draft-7, draft-6, draft-4) Validation using Go
Apache License 2.0
957 stars 98 forks source link

Detailed output missing info #141

Open jose-tim opened 11 months ago

jose-tim commented 11 months ago

Hi, I'm trying to validate a input using a json schema (draft 2022-12), but can't get any useful info for my users. I only get "a type is a string but an object was expected" message, but I need to tell them "your property 'example_prop' was a string but an object was expected".

My code: imagen

Console error:

invalid payload: [I#] [S#] doesn't validate with file:(REDACTED)# [I#] [S#/type] expected object, but got string

Postman error: imagen