-
-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
Hi, I could not find Decode.uri (or equivalent) that would be the same as Decode.string |> Decode.map System.Uri.
Decoding URIs is very common so I had to write the following extension to add the very handy Decode.uri and Encode.uri features:
[<AutoOpen>]
module ThothExtensions
open System
open Thoth.Json.Core
module Thoth =
module Json =
module Core =
module Decode =
let uri: Decoder<Uri> = Decode.string |> Decode.map Uri
module Encode =
let uri: Encoder<Uri> = _.ToString() >> Encode.stringJust like the super-useful Decode.guid and Encode.guid, would it be possible to have Decode.uri and Encode.uri directly out of the box of Thoth.Json?
Metadata
Metadata
Assignees
Labels
No labels