Skip to content

Commit 379868b

Browse files
committed
improve justification
1 parent 8ac5ca7 commit 379868b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/malli/core.cljc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,9 +1930,11 @@
19301930
;; useful for detecting cycles.
19311931
;; copied to malli.generator
19321932
(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.
1933+
;; TODO mr/-schemas doesn't seem right, making defn private for now.
1934+
;; e.g., we only care about property registry entries, not schema constructors.
1935+
;; a better approach might be to accumulate a 'seen' map from name => ?schema
1936+
;; that we add to every time we deref a ref, and if we expand the same name again
1937+
;; with the same seen map, it's a cycle.
19361938
{:scope (-> schema -options -registry mr/-schemas)
19371939
:name (-ref schema)})
19381940

0 commit comments

Comments
 (0)