Hi all, is there a good way to a) use custom opts (disabling printing specs) b) use expound to format some but not all spec errors (only the ones intended to be read by operators of the system) Browsing through the code it seems that you can only set custom-opts via set! or alter-var-root with custom-printer which would effect all spec errors
@dev964 Are you looking to use spec to print out instrumentation errors or errors on some data that you have in your program?
e.g. checking some data that incoming from another part of the system
the second one
and I ended up not using expound in the end …
Would binding
work in your case?
(binding [s/*explain-out* (expound/custom-printer {:show-valid-values? true})]
(s/explain (s/coll-of string?) ["" "" 3]))
That would apply the custom settings only for the block of the binding
yes, would work - but it was easier to construct the messages myself this time
Ah, OK, sounds good!
In a future version, you’ll be able to do (expound/expound (s/coll-of string?) ["" "" 3] {:show-valid-values? true})
to add the options inline, but I haven’t released that yet
In any case, glad you found a solution!