-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add JSON/YAML serialization to URI
#10404
Add JSON/YAML serialization to URI
#10404
Conversation
I think these should live in "uri/json" and "uri/yaml" respectively. It doesn't break now, but nothing prevents us in the future from type-checking the arguments even before you call the methods (a bit more reliable) and then it will break. |
Can we delay this until it becomes necessary if ever? I know we do the same thing for other types, but it just feels like an unneccesary burdon on usability if you have to require these simple converter methods explicitly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @straight-shoota 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would love this in 1.0.0 🥰
I am with Ary. I think we must keep it consistent with the rest of the lib. We can discuss later a refactor here and there. |
URI can be trivially serialized to a string in both JSON and YAML, so this adds the necessary conversion methods.
Note that this does not make
require "json"
/require "yaml"
mandatory when usingrequire "uri"
. The methods just won't work unless JSON/YAML are also required.