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

Add new utility functions: m/explain-data, m/data-explainer, mu/keys #707

Merged
merged 8 commits into from
May 25, 2022
Merged

Add new utility functions: m/explain-data, m/data-explainer, mu/keys #707

merged 8 commits into from
May 25, 2022

Conversation

opqdonut
Copy link
Member

The main issue I'm trying to fix here is not being able to serialize the output of m/explain. See commit message for more.

mu/keys was just something simple I've been missing so I'm adding it in the same PR :)

src/malli/core.cljc Outdated Show resolved Hide resolved
test/malli/core_test.cljc Outdated Show resolved Hide resolved
The output of m/explainer, m/explain isn't serializable as-is. You get
an error like

InvalidDefinitionException: No serializer found for class
malli.core$_map_schema$reify$reify__9118

Provide alternatives m/data-explainer and m/explain-data which walk
over the result and transform schemas to data using m/form.
Copy link
Member

@ikitommi ikitommi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good and clean PR, some changes requested.

src/malli/core.cljc Outdated Show resolved Hide resolved
src/malli/core.cljc Outdated Show resolved Hide resolved
src/malli/core.cljc Outdated Show resolved Hide resolved
test/malli/util_test.cljc Show resolved Hide resolved
@opqdonut
Copy link
Member Author

I didn't rebase/squash anything to make reviewing easier. I can squash this into two nice commits if you want.

@opqdonut opqdonut requested a review from ikitommi May 24, 2022 05:52
Copy link
Member

@ikitommi ikitommi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks really good, please update the docs (at least CHANGELOG) before/after merging.

src/malli/util.cljc Outdated Show resolved Hide resolved
@opqdonut opqdonut merged commit 7ef1f23 into metosin:master May 25, 2022
@opqdonut opqdonut deleted the some-utils branch May 25, 2022 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants