File tree 2 files changed +21
-2
lines changed
2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 2318
2318
maybe-set-ref (fn [s r] (if (and ref-key r) (-update-properties s assoc ref-key r) s))]
2319
2319
(-> (walk schema (fn [schema _ children _]
2320
2320
(cond (= :ref (type schema)) schema
2321
- (-ref-schema? schema) (-> children ( first ) ( maybe -set-ref (-ref schema) ))
2321
+ (-ref-schema? schema) (maybe-set-ref ( deref ( -set-children schema children)) (-ref schema))
2322
2322
:else (-set-children schema children)))
2323
2323
{::walk-schema-refs true })
2324
2324
(deref-all )))))
Original file line number Diff line number Diff line change 3069
3069
[:address [:map {:id ::address }
3070
3070
[:street :string ]
3071
3071
[:lonlat {:optional true } [:tuple :double :double ]]]]]
3072
- (m/form (m/deref-recursive schema {::m/ref-key :id }))))))
3072
+ (m/form (m/deref-recursive schema {::m/ref-key :id }))))
3073
+ (testing " util schemas"
3074
+ (let [registry (merge (m/default-schemas ) (mu/schemas ))]
3075
+ (is (= [:map [:x :int ] [:y :int ]]
3076
+ (m/form (m/deref-recursive
3077
+ [:merge
3078
+ [:map [:x :int ]]
3079
+ [:map [:y :int ]]]
3080
+ {:registry registry}))))
3081
+ (is (= [:map {:id ::xymap }
3082
+ [::x [:int {:id ::x }]]
3083
+ [::y [:int {:id ::y }]]]
3084
+ (m/form (m/deref-recursive
3085
+ [:schema {:registry {::x :int
3086
+ ::y :int
3087
+ ::xmap [:map ::x ]
3088
+ ::ymap [:map ::y ]
3089
+ ::xymap [:merge ::xmap ::ymap ]}}
3090
+ ::xymap ]
3091
+ {:registry registry, ::m/ref-key :id }))))))))
You can’t perform that action at this time.
0 commit comments