Skip to content

Add URI.from_json_object_key? and URI#to_json_object_key#14834

Merged
straight-shoota merged 1 commit intocrystal-lang:masterfrom
nobodywasishere:nobody/uri-json-key
Aug 20, 2024
Merged

Add URI.from_json_object_key? and URI#to_json_object_key#14834
straight-shoota merged 1 commit intocrystal-lang:masterfrom
nobodywasishere:nobody/uri-json-key

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
@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