Opened 8 years ago
Last modified 4 years ago
#16279 assigned defect
dojox.json.schema.validate incorrectly reports NULL as valid when object specified
Reported by: | Greg Girty | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | undecided | Milestone: | 1.15 |
Component: | Dojox | Version: | 1.8.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
In the following example, a required object property is validated when only NULL is present:
require(['dojo', 'dojox/json/schema'], function(){ var s = {properties:{foo: {type:['object'], optional:false, properties:{a:{optional:false,type:'string'}} } }} /* Should these not both fail validation?*/ console.log(dojox.json.schema.validate({foo:null}, s)); // valid is true console.log(dojox.json.schema.validate({foo:{}}, s)); // valid is false });
Attachments (1)
Change History (4)
comment:1 Changed 8 years ago by
Owner: | changed from Adam Peller to Kris Zyp |
---|---|
Status: | new → assigned |
Changed 8 years ago by
comment:2 Changed 5 years ago by
Milestone: | tbd → 1.12 |
---|
comment:3 Changed 4 years ago by
Milestone: | 1.13 → 1.15 |
---|
Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.
Note: See
TracTickets for help on using
tickets.
Proposed fix, replaced first long if clause in function checkType