Skip to content
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

Struct serialize to json #13

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

krzykamil
Copy link

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:

dry-rb/dry-struct#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 rom-rb/rom#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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant