Fork me on GitHub

hello folks, it there a predicate for non-nil? I want to make sure that the key is there but it is not nil and I don't care about the value - can't use any? basically


does some? work?


thank you @taylor forgot about that one 🙂

🤝 4

just checking it out locally b/c I’ve never tried using some? for a spec:

(gen/sample (s/gen some?))
=> (() #{} . {} \8 {} {} [] [y5/S? false 5] :k-)


Is there a way to separate the spec of the structure of a data structure from the spec of the data, and allow different "models" to be used in different circumstances? I.e. have a :usergroup {::meetingpoint {...} ::users [{::address ... ::name ...} ...]} (with (s/def ::users (s/* ::user)) for the geo routing part of my application, but ::user {::email ... ::name ...} for the messaging part of my application, but let both parts share the non-structural specs of ::user's data? I.e. can I tell spec "validate this map with structural information X ... switch to a different component of my app ... now validate the same map with structural information Y", with both X and Y using the same leafs and the map being the same, using the same keywords as keys, just the structure being different? (Following up on @stijn's question from earlier and my own discussion with @orestis in #graphql.)