    (s/optional-key :create) CreateArg     ; how to create, if creating
    (s/optional-key :modify) [ModifyArg]}) ; modifications to perform always
 
-(defn get-or-create-session [arg]
+(s/defn get-or-create-session [arg]
   (let [arg (s/validate OldGetOrCreateArg (merge get-or-create-defaults arg))]
     (with-car*
       (car/return

   :action   (s/either :add :remove)
   :tag      s/Str})

(def Requirement
  "A schema for a session requirement."
  (s/either
    (s/pair :session-tag  "type"  s/Str        "tag")
    (s/pair :node-tag     "type"  s/Str        "tag")
    (s/pair :reserved     "type"  s/Str        "reserved")
    (s/pair :session-id   "type"  s/Str        "session id")
    (s/pair :node-id      "type"  s/Str        "node id")
    (s/pair :browser-name "type"  s/Str        "browser")
    (s/pair :current-url  "type"  s/Str        "url")
    (s/pair :not          "type"  Requirement  "requirement")
    (s/pair :and          "type" [Requirement] "requirements")
    (s/pair :or           "type" [Requirement] "requirements")))

(defn maybe-bigdec [x]
  (try (bigdec x) (catch NumberFormatException e nil)))

   (s/optional-key :extra-desired-capabilities) Capabilities
   (s/optional-key :force-create)               s/Bool})

(s/def get-or-create-defaults :- OldGetOrCreateArg
  {:browser-name "firefox"
   :tags []
   :reserved false})

(def GetOrCreateArg
  "The arg to get-or-create-session."
