mirror of
https://github.com/penpot/penpot.git
synced 2025-05-24 20:26:11 +02:00
✨ Make file schema validation configurable using flags
This commit is contained in:
parent
0081db4770
commit
ac3d7f00d5
6 changed files with 43 additions and 12 deletions
|
@ -266,6 +266,14 @@
|
|||
;; Retrieve and return lagged data
|
||||
(get-lagged-changes conn params))))
|
||||
|
||||
(defn- soft-validate-file-schema!
|
||||
[file]
|
||||
(try
|
||||
(val/validate-file-schema! file)
|
||||
(catch Throwable cause
|
||||
(l/error :hint "file schema validation error" :cause cause)))
|
||||
|
||||
file)
|
||||
|
||||
(defn- update-file-data
|
||||
[conn file changes skip-validate]
|
||||
|
@ -295,8 +303,14 @@
|
|||
;; If `libs` is defined, then full validation is performed
|
||||
(cond-> (and (contains? cf/flags :file-validation)
|
||||
(not skip-validate))
|
||||
(-> (val/validate-file! libs)
|
||||
(val/validate-file-schema!)))
|
||||
(val/validate-file! libs))
|
||||
|
||||
(cond-> (and (contains? cf/flags :file-schema-validation)
|
||||
(not skip-validate))
|
||||
(val/validate-file-schema!))
|
||||
|
||||
(cond-> (contains? cf/flags :soft-file-schema-validation)
|
||||
(soft-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