diff --git a/common/src/app/common/schema.cljc b/common/src/app/common/schema.cljc index 54edcf599e..0af10d0f3f 100644 --- a/common/src/app/common/schema.cljc +++ b/common/src/app/common/schema.cljc @@ -420,7 +420,7 @@ :min 0 :max 1 :compile - (fn [{:keys [kind max min] :as props} children _] + (fn [{:keys [kind max min ordered] :as props} children _] (let [kind (or (last children) kind) pred @@ -456,18 +456,23 @@ (fn [value] (every? pred value))) + empty-set + (if ordered + (d/ordered-set) + #{}) + decode (fn [v] (cond (string? v) (let [v (str/split v #"[\s,]+")] - (into #{} xf:filter-word-strings v)) + (into empty-set xf:filter-word-strings v)) (set? v) v (coll? v) - (into #{} v) + (into empty-set v) :else v)) diff --git a/common/src/app/common/types/file.cljc b/common/src/app/common/types/file.cljc index f7ee4c06de..066f048526 100644 --- a/common/src/app/common/types/file.cljc +++ b/common/src/app/common/types/file.cljc @@ -106,7 +106,7 @@ [:version :int] [:features ::cfeat/features] [:migrations {:optional true} - [::sm/set :string]]]) + [::sm/set {:ordered true} :string]]]) (sm/register! ::data schema:data) (sm/register! ::file schema:file)