[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: |
|
||||||||
| 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 |