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

Add URI.from_json_object_key? and URI#to_json_object_key #14834

Merged

Conversation

nobodywasishere
Copy link
Contributor

No description provided.

@straight-shoota straight-shoota added this to the 1.14.0 milestone Aug 18, 2024
@straight-shoota straight-shoota changed the title Add method for serializing/deserializing a URI as a JSON key Add URI.from_json_object_key? and URI#to_json_object_key Aug 20, 2024
@straight-shoota straight-shoota merged commit 41f75ca into crystal-lang:master Aug 20, 2024
61 checks passed
@nobodywasishere nobodywasishere deleted the nobody/uri-json-key branch October 5, 2024 07:09
@zw963
Copy link
Contributor

zw963 commented Oct 10, 2024

There is no any discuss info for this merged PR, i guess it for deserialize the url string into an URI object directly, right?

@nobodywasishere
Copy link
Contributor Author

nobodywasishere commented Oct 10, 2024

@zw963 Yes, this is used for serializing/deserializing a URI as a hash key.

str = <<-JSON
{ 
  "https://example.com": "hello world"
}
JSON

thing = Hash(URI, String).from_json(str)

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

Successfully merging this pull request may close these issues.

5 participants