katt icon indicating copy to clipboard operation
katt copied to clipboard

Copy big json structures between requests and transactions

Open faragoa opened this issue 5 years ago • 1 comments

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).

faragoa avatar Mar 13 '19 09:03 faragoa

Thanks for your idea.

I missed replying to you because

  1. 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 a struct 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
  2. 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!

andreineculau avatar May 07 '22 11:05 andreineculau