Skip to content

Commit c650cc0

Browse files
committed
Added #1433 to the docs
1 parent 561ebc1 commit c650cc0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/usage/serialization.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,27 @@ property of the response. Read more about it in the [Error Handling](exceptions.
1010

1111
## Default Serializers
1212

13+
RestSharp core package includes a few default serializers for both JSON and XML formats.
14+
15+
### JSON
16+
1317
The default JSON serializer uses the forked version of `SimpleJson`. It is very simplistic and
1418
doesn't handle advanced scenarios in many cases. We do not plan to fix or add new features
1519
to the default JSON serializer, since it handles a lot of cases already and when you need
1620
to handle more complex objects, please consider using alternative JSON serializers mentioned below.
1721

22+
There's a [known issue](https://github.com/restsharp/RestSharp/issues/1433) that SimpleJson doesn't use the UTC time zone when the regular .NET date format
23+
is used (`yyyy-MM-ddTHH:mm:ssZ`). As suggested in the issue, it can be solved by setting the
24+
date format explicitly for SimpleJson:
25+
26+
```csharp
27+
client.UseSerializer(
28+
() => new JsonSerializer { DateFormat = "yyyy-MM-ddTHH:mm:ss.FFFFFFFZ" }
29+
);
30+
```
31+
32+
### XML
33+
1834
You can use either the default XML serializer or the `DotNetXmlSerializer`, which uses `System.Xml.Serialization` library
1935
from .NET. To use the `DotNetXmlSerializer` you need to configure the REST client instance:
2036

0 commit comments

Comments
 (0)