I have…
- [ X] Read the following guideline: Troubleshooting and Support - Squidex. I understand that my support request might get deleted if I do not follow the guideline.
- Used code blocks with ``` to format my code examples like JSON or logs properly.
I’m submitting a…
- Regression (a behavior that stopped working in a new release)
- Bug report
- Performance issue
- Documentation issue or request
Current behavior
(I checked Bug report but 99% I’m newbie and I miss something…)
I have a simple schema with a datetime field that I mapped with
[Newton.JsonProperty()]
public DateTime PublishDate { get; set; }
when I try to retrieve with the .net sdk
var youtubeVideoClient = client.Contents<YoutubeVideo, YoutubeVideoData>("youtubevideo");
var video = await youtubeVideoClient.GetAsync("fd8ae577-a6c9-4ad2-824a-ed49bd24fcfb");
I receive an error
Unhandled exception. Newtonsoft.Json.JsonSerializationException: Unexpected token parsing date. Expected String, got StartObject. Path ‘data.PublishDate’, line 1, position 357.
at Newtonsoft.Json.Converters.IsoDateTimeConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
The field is correctly populated (checked with Preview and Postman)
“PublishDate”: {
“en”: “2023-02-20T00:00:00Z”,
“de”: “2023-11-17T00:00:00Z”,
“it”: “2023-02-20T00:00:00Z”
}
Expected behavior
No parsing error
Minimal reproduction of the problem
Environment
App Name:
- Self hosted with docker
- Self hosted with IIS
- Self hosted with other version
- [ X] Cloud version
Version: [VERSION]
Browser:
- [X ] Chrome (desktop)
- Chrome (Android)
- Chrome (iOS)
- Firefox
- Safari (desktop)
- Safari (iOS)
- IE
- Edge
Others:
“Newtonsoft.Json” Version=“13.0.3”
“Squidex.ClientLibrary” Version=“19.1.0”
Thank you