[SERVER-32093] 3.6 $jsonSchema validator error message improvements Created: 27/Nov/17  Updated: 27/Nov/17  Resolved: 27/Nov/17

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 3.6.0-rc4
Fix Version/s: None

Type: Improvement Priority: Trivial - P5
Reporter: Ken W. Alger Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-20547 Expose the reason an operation fails ... Closed
Participants:

 Description   

When a document fails validation from a prescribed schema a WriteError is generated with a

{{"code": 121,
"errmsg" : "Document failed validation"}}

message. It would be great if the error message would be more explicit as to why the write failed, i.e. which rule was violated. Or, allow for an error parameter to be included in the schema validation rules to allow for custom messaging if a rule is violated, i.e. error: "Are you sure that you are passing in an 'int' value?".



 Comments   
Comment by Kyle Suarez [ 27/Nov/17 ]

Hi kenwalger,

Thank you for your improvement suggestion. We already have a request for this in SERVER-20547. That work would indicate why a document failed validation for any document validator, including (but not just limited to) JSON Schema validators. Please vote for that ticket and watch it for future updates.

Regards,
Kyle

Generated at Thu Feb 08 04:29:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.