mirror of
https://github.com/penpot/penpot.git
synced 2025-05-23 07:46:10 +02:00
✨ Improve schema validation handling
And properly honor the file-validation flag
This commit is contained in:
parent
3eb987897a
commit
ec8b68721b
6 changed files with 54 additions and 42 deletions
|
@ -266,6 +266,7 @@
|
|||
;; Retrieve and return lagged data
|
||||
(get-lagged-changes conn params))))
|
||||
|
||||
|
||||
(defn- update-file-data
|
||||
[conn file changes skip-validate]
|
||||
(let [file (update file :data (fn [data]
|
||||
|
@ -278,7 +279,6 @@
|
|||
;; some other way to do general validation
|
||||
libs (when (and (contains? cf/flags :file-validation)
|
||||
(not skip-validate))
|
||||
;; FIXME: we need properly handle pointer-map here ????
|
||||
(->> (files/get-file-libraries conn (:id file))
|
||||
(into [file] (map (fn [{:keys [id]}]
|
||||
(binding [pmap/*load-fn* (partial files/load-pointer conn id)]
|
||||
|
@ -293,7 +293,10 @@
|
|||
(update :data cpc/process-changes changes)
|
||||
|
||||
;; If `libs` is defined, then full validation is performed
|
||||
(val/validate-file! libs)
|
||||
(cond-> (and (contains? cf/flags :file-validation)
|
||||
(not skip-validate))
|
||||
(-> (val/validate-file! libs)
|
||||
(val/validate-file-schema!)))
|
||||
|
||||
(cond-> (and (contains? cfeat/*current* "fdata/objects-map")
|
||||
(not (contains? cfeat/*previous* "fdata/objects-map")))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue