   (rejected-unexpected-fields #{:properties :additionalProperties :required :oneOf :anyOf} schema-type)
   (if-let [one-of (:oneOf schema-type)]
     (object-one-of->generator schema type-name schema-type)
-
     ;; else
     (if-let [any-of (:anyOf schema-type)]
       (->> any-of

  [schema type-name schema-type]
  (rejected-unexpected-fields #{:items :minItems :maxItems} schema-type)
  (let [{:keys [items minItems maxItems]} (merge array-defaults schema-type)
        item-generator (schema-type->generator schema type-name items)
        ;; Limit the maximum number of items in an array to 5.
        maxItems (min maxItems 5)]
    (if (= minItems 0)

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

(defn- non-empty-obj-gen
  [g]
  (gen/fmap (fn [x]
              (when (some some? (vals x))
                x))
            g))

(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
