expound

Charlie Briggs 2020-10-12T15:59:59.002200Z

if I’m seeing <can't find spec for unqualified spec identifier>, I assume that’s because my spec definitions don’t match my namespace structure? e.g. I’ve got :contract.product/start-date in signal.accounts.spec.accounts is there anything I can do to make that work while continuing to namespace my specs somehow in the same namespace (e.g. we have account and contract entities, they both have the same nested keys such as name, id, which might have different specs)

bbrinck 2020-10-14T22:02:47.008600Z

This can occur when using unqualified specs in a ‘keys’ spec i.e. using ‘req-in’ or ‘opt-un’. The issue isn’t related to the namespace structure, it’s just that expound can’t figure out what spec you mean if the explain data only refers to the unqualified key e.g. :name.

bbrinck 2020-10-14T22:04:06.010500Z

The only real solution is to use ‘req’ instead - its an issue with the lack of information included in the explain data returned by clojure.spec

bbrinck 2020-10-14T22:05:25.012500Z

Hopefully that makes sense. It’s confusing. If you post the explain data, I can provide more specifics. It might be something that could be fixed upstream in spec though :man-shrugging:

bbrinck 2020-10-14T22:06:54.013400Z

It’s also possible this is a bug in Expound, but I’d have to see the explain data to know for sure

Charlie Briggs 2020-10-16T10:13:50.013600Z

ah, thank you very much. That does make some sense! I might get back to you if I’m working on the specific project where I’ve seen this any time soon ☺️

👍 1