Closed krzykamil closed 1 week ago
@krzykamil Can you take another look at this and fix the CI failures? They seem straight-forward to fix, happy to take it over if needed.
@cllns my bad, completely forgot about this and the rubocop. Should be fixed now
Thanks @krzykamil! Do you mind changing it so that the args are passed through to the underlying .to_json
? I don't think people use it much, but we might as well use the args instead of dropping them.
Thanks @krzykamil! Do you mind changing it so that the args are passed through to the underlying
.to_json
? I don't think people use it much, but we might as well use the args instead of dropping them.
I'll do it over the weekend, no problem
Thanks for the contribution, @krzykamil! I did some cleanup history rewriting on the commits so GitHub doesn't see it as a merge, but you're still listed as the author.
https://github.com/orgs/hanami/projects/6/views/1?pane=issue&itemId=70528802
This just adds a simple json conversion to struct attributes. Dumps to hash and then json.
I saw the issue description mentioned that it could also be moved to ROM or DRY gems, but I found two discussion that convinced me against it:
https://github.com/dry-rb/dry-struct/issues/166 here Nikita said "Serializing to JSON is not part of the gem and I'm against mixing concerns in general." and in the ROM thread, there was a similar mention, by Piotr https://github.com/rom-rb/rom/issues/403 "In general I would recommend encapsulating json serialization/deserialization with your own APIs, instead of referring to 3rd party gems"
So i thought its best not to nest this method too deep in those gems