I'm trying to spec a large, complicated map for a bunch of game data. there are several possible states the game might be in, and the fields vary depending on which state we're in. I want a spec something like
(s/def ::state-pregame (s/merge ::state-core (s/keys pregame-specific-things) {::state :states/pregame}))
where the key is that last bit, specifying a particular key and value pair for the pregame state.
oh, TIL about multi-spec
, which is exactly this.