katt
katt copied to clipboard
Copy big json structures between requests and transactions
blueprint:
POST ... { "transaction":"1", "big-chunk-input:":{ "small-chunk":"123",big-chunk:{"a":"1",....} } .. } <200 .. { "some-big-chunk":{{>BigChunk1}} .. }
POST ... { "transaction":"2", "big-chunk-input":{{<BigChunk1}}, .. }
Also works if you save BigChunk1 to Erlang between two katt runs from the returned proplist of the results tuple (third param).
Thanks for your idea.
I missed replying to you because
- the PR in its current form cannot be merged. I can understand how it solves your case, but it is not clear how
to_list
is fine taking astruct
and leaving it as is (potentially with atoms or binaries. What you want is to get around a "limitation" on this line https://github.com/for-GET/katt/blob/934977bb56277c4ac631a0be3b1c09bcb9602d8f/src/katt.erl#L188 - currently we support "primitives" which also keeps things aligned with the CLI tool. Adding the possibility to handle complex structures in Erlang, means we either document the shortcoming for the CLI tool or find a way to support that.
I'm leaving this PR as is until we figure out how to handle better the case of params with complex values.
Welcome to bring up other ideas!