 
   (is (= {:error-type :conditional-failed
           :error-key :onyx/type
+          :error-value {:onyx/type :reader}
+          :path nil
           :predicates '[onyx-input-task-type
                         onyx-output-task-type
                         onyx-function-task-type]}
          (validate! os/TaskMap {:onyx/type :reader})))
 
   (is (= {:error-type :missing-required-key
-          :missing-key :onyx/plugin}
+          :missing-key :onyx/plugin
+          :path [:onyx/plugin]}
          (validate! os/TaskMap {:onyx/type :input})))
 
   (is (= {:error-type :conditional-failed
-          :predicates ['keyword-namespaced?
-                       'keyword?]
-          :error-key :onyx/plugin}
+          :error-value "Foo"
+          :predicates ['keyword-namespaced? 'keyword?]
+          :error-key :onyx/plugin
+          :path [:onyx/plugin]}
          (validate! os/TaskMap {:onyx/type :input
                                 :onyx/plugin "Foo"})))
 
   (is (= {:error-type :missing-required-key
-          :missing-key :onyx/medium}
+          :missing-key :onyx/medium
+          :path [:onyx/medium]}
          (validate! os/TaskMap {:onyx/type :input
                                 :onyx/plugin :a})))
 

  (try
    (s/validate schema v)
    (catch Throwable t
      (a/analyze-error t))))

(deftest workflow-errors
  (is (= {:error-type :value-predicate-error
          :error-key 1
          :error-value "b"
          :predicate 'task-name?}
         (validate! os/Workflow [[:a "b"]])))

  (is (= {:error-type :type-error
          :expected-type clojure.lang.PersistentVector
          :found-type clojure.lang.Keyword
          :error-key 1
          :error-value :c}
         (validate! os/Workflow [[:a :b] :c])))

  (is (= {:error-type :constraint-violated
          :predicate 'edge-two-nodes?}
         (validate! os/Workflow [[:a :b :c]]))))

(deftest task-map-errors
  (is (= {:error-type :conditional-failed
          :error-key nil
          :predicates '[onyx-input-task-type
                        onyx-output-task-type
                        onyx-function-task-type]}

          :expected-type java.lang.Integer
          :found-type clojure.lang.Keyword
          :error-value :invalid
          :error-key :onyx/batch-size
          :path [:onyx/batch-size]}
         (validate! os/TaskMap {:onyx/name :hello
                                :onyx/type :input
                                :onyx/plugin :a
