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:
parent
960f095c1b
commit
0d08549a04
1 changed files with 25 additions and 6 deletions
|
@ -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? %))
|
||||
|
|
Loading…
Reference in a new issue