[SERVER-50859] Type mismatches in jsonSchema should only be reported by the 'type' or 'bsonType' keyword Created: 10/Sep/20  Updated: 21/Oct/20  Resolved: 21/Oct/20

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

Type: Improvement Priority: Major - P3
Reporter: Mihai Andrei Assignee: Mihai Andrei
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-49446 Implement validation error generation... Closed
Sprint: Query 2020-10-05, Query 2020-10-19, Query 2020-11-02
Participants:

 Description   

Suppose the validator expression {$jsonSchema: {properties: {a: {type: 'string', minLength: 2}}} fails to match against the document {a: 1}. The generated error will report that there is a type mismatch twice: once for the 'type' keyword and once for the 'minLength' keyword. Ideally, the 'minLength' keyword (or generally speaking, any such scalar keyword) should not produce a type mismatch error since the semantics of these jsonSchema scalar keywords is to fail to match if the instance matches the expected type.



 Comments   
Comment by Mihai Andrei [ 21/Oct/20 ]

Closing this as duplicate of SERVER-49446 as it solves the problem described by this ticket.

Generated at Thu Feb 08 05:23:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.