Avoiding global name collision is the reason why specs are named with namespace-qualified keywords. I am confused by your last sentence though. Do you mean Clojure namespaces or the namespace component of the keyword itself? There is no requirement in clojure.spec that the namespace of the specs you def be coupled to the Clojure namespace they happen to be defined in. If you are actually asking about how to write specs for unqualified keys in a map there is a built-in facility to do that as well: clojure.spec.alpha/keys has a :req-un and :opt-un argument.
On Thursday, December 28, 2017 at 11:28:18 AM UTC-5, Jonathon McKitrick wrote: > > I have one spec question covering two scenarios. > > 1. Suppose I want to spec a payload from a third-party API that has the > keyword ':resultCount' in it. Does that mean my specs for that item must > have the same name? > > 2. Supposed I have a few payloads from that API and each has a keyword > ':result' but the spec for each will be different. Other than using an > entirely different namespace, how can I map the :result keyword to > different specs? > > Thanks! > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.