mirror of
https://github.com/penpot/penpot.git
synced 2025-01-08 16:00:19 -05:00
🐛 Fix regression on sm/vec and sm/set schemas
Introduced in previous commits
This commit is contained in:
parent
960f095c1b
commit
0d08549a04
1 changed files with 25 additions and 6 deletions
|
@ -451,9 +451,18 @@
|
||||||
|
|
||||||
decode
|
decode
|
||||||
(fn [v]
|
(fn [v]
|
||||||
(if (string? v)
|
(cond
|
||||||
|
(string? v)
|
||||||
(let [v (str/split v #"[\s,]+")]
|
(let [v (str/split v #"[\s,]+")]
|
||||||
(into #{} xf:filter-word-strings v))
|
(into #{} xf:filter-word-strings v))
|
||||||
|
|
||||||
|
(set? v)
|
||||||
|
v
|
||||||
|
|
||||||
|
(coll? v)
|
||||||
|
(into #{} v)
|
||||||
|
|
||||||
|
:else
|
||||||
v))
|
v))
|
||||||
|
|
||||||
encode-string-child
|
encode-string-child
|
||||||
|
@ -481,9 +490,7 @@
|
||||||
::oapi/items {:type "string"}
|
::oapi/items {:type "string"}
|
||||||
::oapi/unique-items true}}))})
|
::oapi/unique-items true}}))})
|
||||||
|
|
||||||
(register! ::set type:set)
|
(def type:vec
|
||||||
|
|
||||||
(register! ::vec
|
|
||||||
{:type :vector
|
{:type :vector
|
||||||
:min 0
|
:min 0
|
||||||
:max 1
|
:max 1
|
||||||
|
@ -525,9 +532,18 @@
|
||||||
|
|
||||||
decode
|
decode
|
||||||
(fn [v]
|
(fn [v]
|
||||||
(if (string? v)
|
(cond
|
||||||
|
(string? v)
|
||||||
(let [v (str/split v #"[\s,]+")]
|
(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))
|
v))
|
||||||
|
|
||||||
encode-string-child
|
encode-string-child
|
||||||
|
@ -554,6 +570,9 @@
|
||||||
::oapi/items {:type "string"}
|
::oapi/items {:type "string"}
|
||||||
::oapi/unique-items true}}))})
|
::oapi/unique-items true}}))})
|
||||||
|
|
||||||
|
(register! ::set type:set)
|
||||||
|
(register! ::vec type:vec)
|
||||||
|
|
||||||
(register! ::set-of-strings
|
(register! ::set-of-strings
|
||||||
{:type ::set-of-strings
|
{:type ::set-of-strings
|
||||||
:pred #(and (set? %) (every? string? %))
|
:pred #(and (set? %) (every? string? %))
|
||||||
|
|
Loading…
Reference in a new issue