rse / componentjs

ComponentJS -- Powerful run-time Component System for structuring HTML5-based Rich Clients
http://componentjs.com/
Other
85 stars 13 forks source link

The or conjunction of validate is not working #27

Closed AuspeXeu closed 11 years ago

AuspeXeu commented 11 years ago

The following model definition fails with the error message, that the values does not match the spec.

cs(this).model({
  'data:test': { value: 42, valid: 'object|number' }
})

same with

cs(this).model({
  'data:test': { value: { firstname: 'Hans', lastname: 'Zimmer' }, valid: 'number|object' }
})

Exact error message Error: [ComponentJS]: ERROR: model: model field "data:test" has default value {"firstname":"Hans","lastname":"Zimmer"}, which does not validate against validation "number|object"

rse commented 11 years ago

Now fixed by documentation update.