-
Notifications
You must be signed in to change notification settings - Fork 30
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
Nested map encoding #19
Comments
The The first example you give should probably either raise an error or put the edn-encoded map in, instead. |
This would be a very useful addition. Could it be implemented by adding an optional flag to
In version 1.2.0 this does not raise an error: (require 'ring.util.codec)
;=> nil
(ring.util.codec/form-encode {:a {:b 2}})
;=> "a=b=2" Should this issue be reopened? |
I think open a separate issue, one specifically for better handling the error caused by nested maps. |
Done: #42 |
This library doesn't handle nested maps in a format that can be later decoded with
form-decode
, eg.:(ring.util.codec/form-encode {:a {:b 1 :c 2}}) ;; "a=b=1&c=2"
(ring.util.codec/form-decode "a=b=1&c=2") ;; {"a" "b=1", "c" "2"}
Specifically it should handle nested params in such a way that it is then parseable by
ring.middleware.nested-params
eg.:(ring.util.codec/form-decode "a%5Bb%5D=1&a%5Bc%5D=2") ;; {"a[b]" "1", "a[c]" "2"}
(ring.middleware.nested-params/nested-params-request {:params {"a[b]" "1" "a[c]" "2"}}) ;; {:params {"a" {"b" "1", "c" "2"}}}
Is this something we could fix ?
The text was updated successfully, but these errors were encountered: