Closed bengourley closed 8 years ago
cc @balaclark. This is dedicated to you and #26.
Thank you, pull request merged! See changes here.
:octocat: Sent from GH.
@serby you picked a bad PR to try that GH module out on… see the title ^^^
DOH! I picked the wrong number
:rotating_light: :warning: Work in progress :warning: :rotating_light:
There is currently a feature gap with casting for arrays of simple/primitive types.
Given the following schema:
schemata.cast(obj)
will not cast……into…
Not only would I expect this behaviour, it's also rather difficult to fix from outside schemata. It's quite common to be receiving numerical input as strings from HTML form values. If schemata won't cast these types then type information must leak out from the schema into somewhere else in the application.
As mentioned, this is a work in progress so please do not merge (I actually rediscovered this work as uncommitted changes the other day when fixing a different issue).
Things outstanding:
validate()
on schemata arrays of primitive typesWith these changes so far, the current test suite still passes, but the code coverage has fallen below the threshold.