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 support for uri? in malli.transform (Clojure only) #966

Merged
merged 1 commit into from
Oct 13, 2023

Commits on Oct 12, 2023

  1. Add support for uri? in malli.transform (Clojure only)

    With Reitit (0.7.0-alpha7), using the below route definition, I get a
    failure during the coercion when passing the uri "http://example.com".
    
        ["/uri"
          {:post {:summary "Post a URI - fails coercion"
                  :coercion reitit.coercion.malli/coercion
                  :parameters {:body {:uri uri?}}
                  :responses {200 {:body {:uri uri?}}}
                  :handler (fn [{{{uri :uri} :body} :parameters}]
                             {:status 200 :body {:uri uri}})}}]]
    
    When I replaced the :coercion with the Clojure Spec version, the
    coercion works.
    
    With this change the Malli coercer should also work.
    
    I made it Clojure specific since it relies on `java.net.URI`.
    stig committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    0fae27f View commit details
    Browse the repository at this point in the history