File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 19281928
19291929; ; returns an identifier for the :ref schema in the context of its dynamic scope.
19301930; ; useful for detecting cycles.
1931- (defn -identify-ref-schema [schema]
1931+ ; ; copied to malli.generator
1932+ (defn- -identify-ref-schema [schema]
1933+ ; ; TODO mr/-schemas doesn't seem reliable, making defn private for now.
1934+ ; ; a better approach would be to accumulate a 'seen' map from name => ?schema
1935+ ; ; and if we expand the same name again with the same seen map, it's a cycle.
19321936 {:scope (-> schema -options -registry mr/-schemas)
19331937 :name (-ref schema)})
19341938
Original file line number Diff line number Diff line change 295295; ; ;; (1)
296296; ; [:or [:ref ::a] [:ref ::b]]]]
297297
298+ ; ; copied to malli.core
299+ (defn- -identify-ref-schema [schema]
300+ {:scope (-> schema m/-options m/-registry mr/-schemas)
301+ :name (m/-ref schema)})
302+
298303(defn -ref-gen [schema options]
299- (let [ref-id (m/ -identify-ref-schema schema)]
304+ (let [ref-id (-identify-ref-schema schema)]
300305 (or (force (get-in options [::rec-gen ref-id]))
301306 (let [scalar-ref-gen (delay (-never-gen options))
302307 dschema (m/deref schema)]
You can’t perform that action at this time.
0 commit comments