0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-06 14:50:20 -05:00

🐛 Fix regression on sm/vec and sm/set schemas

Introduced in previous commits
This commit is contained in:
Andrey Antukh 2024-11-08 19:50:59 +01:00
parent 960f095c1b
commit 0d08549a04

View file

@ -451,9 +451,18 @@
decode
(fn [v]
(if (string? v)
(cond
(string? v)
(let [v (str/split v #"[\s,]+")]
(into #{} xf:filter-word-strings v))
(set? v)
v
(coll? v)
(into #{} v)
:else
v))
encode-string-child
@ -481,9 +490,7 @@
::oapi/items {:type "string"}
::oapi/unique-items true}}))})
(register! ::set type:set)
(register! ::vec
(def type:vec
{:type :vector
:min 0
:max 1
@ -525,9 +532,18 @@
decode
(fn [v]
(if (string? v)
(cond
(string? v)
(let [v (str/split v #"[\s,]+")]
(into #{} xf:filter-word-strings v))
(into [] xf:filter-word-strings v))
(vector? v)
v
(coll? v)
(into [] v)
:else
v))
encode-string-child
@ -554,6 +570,9 @@
::oapi/items {:type "string"}
::oapi/unique-items true}}))})
(register! ::set type:set)
(register! ::vec type:vec)
(register! ::set-of-strings
{:type ::set-of-strings
:pred #(and (set? %) (every? string? %))