how to build complex hashes via build_nested_query and parse them correctly? #2158
-
Use case:input = {{hello: "hola", world: "mundo"} => "spanish"}
#=> {{:hello=>"hola", :world=>"mundo"}=>"spanish"}
query = Rack::Utils.build_nested_query(input)
# => "%7B%3Ahello%3D%3E%22hola%22%2C+%3Aworld%3D%3E%22mundo%22%7D=spanish"
# but the output stringifies the key!!
output = Rack::Utils.parse_nested_query(query)
# => {"{:hello=>\"hola\", :world=>\"mundo\"}"=>"spanish"}
# I would like the original hash! The Goal:
Question: Is there any way that this can be done? Allusion to this was made here - but the implementation is not still clear to me. any pointers would be appreciated. Similar discussions |
Beta Was this translation helpful? Give feedback.
Answered by
jeremyevans
Feb 20, 2024
Replies: 1 comment 4 replies
-
Rack's query parameter serialization format does not support this. You would have to write your own parameter serializer/deserializer. |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
ioquatix
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rack's query parameter serialization format does not support this. You would have to write your own parameter serializer/deserializer.