-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Help Wanted] How can I get descriptive error messages when the schema is invalid. #56
Comments
I never implemented descriptive error messaging. The theory was that the standard JSON Schema output format, would allow people to write tools to consume that format to give you nice error messaging that makes sense for your specific use case. There are a couple such implementations that use AJV's proprietary output format. There's one designed for CLI consumption and another designed for API responses. Unfortunately, no one ever built things like that for the standard output format, so for now there isn't really something I can point you to solve this problem. I'll have to give up waiting for someone else to do it and do it myself, but I haven't had time yet. I recently shared with another user some code to get started if you want to see how to build out some messaging yourself. |
Thanks a lot! |
I think you can leave it open. It will help others with the same question find the answer they're looking for. I'll close it in the future if/when the situation changes. |
The reason no one (including the AJV maintainer) has written the standard message parser is because it is a humongous task once you realize it is pretty useless without multilang support. And multilang support brings its own can of worms: bloated bundle size for client and exploding string cache for server to name a few. |
@JeelRajodiya @jdesrosiers hi i am very new to open source and this is my first time asking a doubt i just wanted to ask if we encounter problem to get descriptive error messages in typescript only or in other languages as well because i feel python can handle descriptive error messages pretty well. |
I have the following schema
and following data
Now when I validate the schema, the I get the following error
My code
What I am looking for is a descriptive error similar to what cfworker/json-schema throws
Items did not match schema. Instance type "number" is invalid. Expected "string".
The text was updated successfully, but these errors were encountered: