diff --git a/Fable.Remoting.DotnetClient/Fable.Remoting.DotnetClient.fsproj b/Fable.Remoting.DotnetClient/Fable.Remoting.DotnetClient.fsproj
index 933025a..2f1e545 100644
--- a/Fable.Remoting.DotnetClient/Fable.Remoting.DotnetClient.fsproj
+++ b/Fable.Remoting.DotnetClient/Fable.Remoting.DotnetClient.fsproj
@@ -7,10 +7,10 @@
fsharp;fable;remoting;rpc;webserver;json
Zaid Ajaj
- 3.31.0
+ 3.32.0
net462;netstandard2.0;net6.0
true
- Update MsgPack to work on dotnet 8
+ Fix strings being inferred as dates when parsing the JSON
diff --git a/Fable.Remoting.DotnetClient/Proxy.fs b/Fable.Remoting.DotnetClient/Proxy.fs
index cfada01..7b9f3eb 100644
--- a/Fable.Remoting.DotnetClient/Proxy.fs
+++ b/Fable.Remoting.DotnetClient/Proxy.fs
@@ -24,7 +24,10 @@ module Proxy =
/// Parses a JSON iput string to a .NET type using Fable JSON converter
let parseAs<'t> (json: string) =
- JsonConvert.DeserializeObject<'t>(json, converter)
+ let options = JsonSerializerSettings()
+ options.Converters.Add converter
+ options.DateParseHandling <- DateParseHandling.None
+ JsonConvert.DeserializeObject<'t>(json, options)
/// Parses a byte array to a .NET type using Message Pack
let parseAsBinary<'t> (data: byte[]) =
diff --git a/Fable.Remoting.IntegrationTests/DotnetClient/DotnetClient.fsproj b/Fable.Remoting.IntegrationTests/DotnetClient/DotnetClient.fsproj
index 56e29b3..2dd5dc9 100644
--- a/Fable.Remoting.IntegrationTests/DotnetClient/DotnetClient.fsproj
+++ b/Fable.Remoting.IntegrationTests/DotnetClient/DotnetClient.fsproj
@@ -13,7 +13,7 @@
-
+
diff --git a/Fable.Remoting.IntegrationTests/DotnetClient/Program.fs b/Fable.Remoting.IntegrationTests/DotnetClient/Program.fs
index a73c6c5..8c9bbb5 100644
--- a/Fable.Remoting.IntegrationTests/DotnetClient/Program.fs
+++ b/Fable.Remoting.IntegrationTests/DotnetClient/Program.fs
@@ -546,6 +546,16 @@ let dotnetClientTests =
let! output = server.echoMapTask expected |> Async.AwaitTask
Expect.equal output expected "Echoed map is correct"
}
+
+ testCaseAsync "IServer.getPostTimestamp" <| async {
+ let! output = server.getPostTimestamp()
+ Expect.equal output staticTimestampText "Timestamp is correct"
+ }
+
+ testCaseAsync "IServer.getPostTimestamp_Result" <| async {
+ let! output = server.getPostTimestamp_Result()
+ Expect.equal output (Ok staticTimestampText) "Timestamp is correct"
+ }
]
let testConfig = { Expecto.Tests.defaultConfig with
diff --git a/Fable.Remoting.IntegrationTests/DotnetClient/paket.references b/Fable.Remoting.IntegrationTests/DotnetClient/paket.references
index a796b20..f87d828 100644
--- a/Fable.Remoting.IntegrationTests/DotnetClient/paket.references
+++ b/Fable.Remoting.IntegrationTests/DotnetClient/paket.references
@@ -1,6 +1 @@
-FSharp.Core
-Expecto
-Suave
-
-group Client
-Fable.Core
\ No newline at end of file
+Expecto
\ No newline at end of file
diff --git a/Fable.Remoting.IntegrationTests/Shared/ServerImpl.fs b/Fable.Remoting.IntegrationTests/Shared/ServerImpl.fs
index 04ae74c..d4ff224 100644
--- a/Fable.Remoting.IntegrationTests/Shared/ServerImpl.fs
+++ b/Fable.Remoting.IntegrationTests/Shared/ServerImpl.fs
@@ -128,6 +128,8 @@ let serverBinary : IBinaryServer = {
echoMapTask = fun map -> Task.FromResult map
}
+let staticTimestampText = "2023-12-03T11:49:41"
+
// Async.result : 'a -> Async<'a>
// a simple implementation, just return whatever value you get (echo the input)
let server : IServer = {
@@ -230,4 +232,11 @@ let server : IServer = {
pureTask = Task.FromResult 42
echoMapTask = fun map -> Task.FromResult map
+ getPostTimestamp = fun () -> async {
+ return staticTimestampText
+ }
+
+ getPostTimestamp_Result = fun () -> async {
+ return Ok staticTimestampText
+ }
}
\ No newline at end of file
diff --git a/Fable.Remoting.IntegrationTests/Shared/SharedTypes.fs b/Fable.Remoting.IntegrationTests/Shared/SharedTypes.fs
index 95c9b3b..a6e98bc 100644
--- a/Fable.Remoting.IntegrationTests/Shared/SharedTypes.fs
+++ b/Fable.Remoting.IntegrationTests/Shared/SharedTypes.fs
@@ -2,7 +2,9 @@ module SharedTypes
open System
open System.Threading.Tasks
+#if FABLE_COMPILER
open Fable.Core
+#endif
type Record = {
Prop1 : string
@@ -55,8 +57,9 @@ type SomeEnum =
| Val0 = 0
| Val1 = 1
| Val2 = 2
-
+#if FABLE_COMPILER
[]
+#endif
type SomeStringEnum =
| FirstString
| SecondString
@@ -294,6 +297,8 @@ type IBinaryServer = {
#endif
}
+type PostTimestamp = string
+
type IServer = {
// primitive types
simpleUnit : unit -> Async
@@ -397,6 +402,8 @@ type IServer = {
command: CommandLabel * RequesterIdentifier * Requests.Command -> Async
echoPosition : Position -> Async
simulateLongComputation: int -> Async
+ getPostTimestamp: unit -> Async
+ getPostTimestamp_Result: unit -> Async>
// mixed Task on the server, Async in JS
#if TASK_AS_ASYNC || FABLE_COMPILER