                 :let [selected-properties (concat required-properties
                                                   (subvec optional-properties
                                                           0 num-optional-fields))
+                      ;; Check for dependencies, remove properties that lack their dependencies
+                      selected-properties (if (not (empty? dependencies))
+                                            (remove #(lacks-dependency? % dependencies selected-properties)
+                                                    selected-properties)
+                                            selected-properties)
                       ;; Create a map of property names to generators
                       selected-prop-gens (select-keys prop-gens selected-properties)]
                 ;; Generate a hash map containing the properties

      (throw (Exception. (format "The fields [%s] are not supported by generators with schema type [%s]"
                                 (pr-str unexpected-fields) (pr-str schema-type)))))))

(defn- object-like-schema-type->generator
  "Takes an object-like schema type and generates a generator. By \"object-like\" it means a map
  with keys properties, required, and additionalProperties. This is used to handle a normal object
  with properties or an object which uses oneOf to specify between lists of properties."
  [schema type-name schema-type]
  (rejected-unexpected-fields #{:properties :required :additionalProperties :not :allOf} schema-type)
  (let [constructor-fn (if type-name
                         (record-gen/schema-type-constructor schema type-name)
                         identity)

        properties (if (= 0 (rand-int 2))
                     (dissoc properties :ComposedOf)
                     properties)
        dependencies (:dependencies schema-type)
        ;; Create a map of property keys to generators for those properties
        prop-gens (into {} (for [[k subtype] properties]
                             [k (schema-type->generator schema nil subtype)]))
