Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get more verbose schema error output than :malli.core/invalid-schema? #1103

Open
theronic opened this issue Sep 2, 2024 · 1 comment

Comments

@theronic
Copy link

theronic commented Sep 2, 2024

I'm working on a large Clojure client project with hundreds of Malli schemas. When I try to run tests locally, I just get :malli.core/invalid-schema errors. I tried to instrument using (malli.instrument/instrument!) in the calling namespace, but this does not change error output. Perhaps it does not propagate down to imported namespaces?

I tried to do this:

(def default-schemas
  (mr/custom-default-registry
    (merge
      (m/default-schemas)
      {:my-schemas {}
       ::m/explain-errors true})))

But getting argument errors.

Is there a way to turn on global schema error reporting so I can figure out which schema is causing the invalid-schema error, please?

@theronic
Copy link
Author

theronic commented Sep 2, 2024

OK, so I managed to trace it down by turning on (malli.dev/start! {:report (pretty/reporter)}) until I found the issue. The cause seems to be that namespaces with Malli schema definitions are not being evaluated until I manually eval them, even though they are in :require. So this is not a Malli issue, but I have no idea how to fix it.

Feel free to close, but maybe someone knows why this is happening?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant