Open robdembitel opened 1 week ago
Thanks! We're triaging this issue and aim to have a fix next week.
Hi @robdembitel,
We have identified this as a feature request and have opened ticket #8 and assigned @abelino to implement it. Speck is intended to work with third-party APIs that may not be the best behaved, and that a user of Speck may not have the ability to change. Due to this, Speck first makes a best-effort to coerce, and then validates. In other words, the attribute type is the output type rather than the input type. However, there are cases where strict validation (validation before coercion) would be helpful, so we're happy to add this feature.
Are you blocked without this?
Hi @amclain - all good. I am not blocked by this, yet it would be good to get the strict validation as you described.
Just let me know as soon as you have it - Thanks for adding the feature.
Hi,
I found a bug while validating this spec:
As defined in the spec above
path
must be an array containing values of typestring
.Validating this invalid payload (it contains an integer instead of a string) with Spec should return an error, but it does not.
In this case
Speck.validate
returns{:ok, ...}