Closed mtaku3 closed 1 year ago
Thanks a lot. I see, you are right, sorry I think I rushed with the last changes I made. About the first issue: is caused by the need of a double implementation for async and sync methods in order to avoid async to sync conversions:
Again thanks!
This PR includes a fix of two issues.
The first issue
The first issue is a invalid JSON deserialization of uses System.Text.Json's JSON deserializer, which is case sensitive by default. But pocketbase-csharp-sdk is using HttpClient's method in order to deserialize, so that JSON deserializer uses case-insensitive option.
What we need to add is JSON serialization options of case-insensitive to JSON deserializer.
I used
PocketBaseExtensions.Send<T>
. In previous version, PocketBaseClient was using pocketbase-csharp-sdk's SendAsync method. But in v0.6.0, it seems like you have migrated from it to PocketBaseExtensions. PocketBaseExtensions.SendJsonSerializerDefaults.Web
rather than creating our own serializer options. Because pocketbase-csharp-sdk is based on this options according to this article.The second issue
I found that my previous PR about invalid json deserialization wasn't fully fixed. The main cause of it is
AddInternal
is being called before all fields of a item being set. I'll explain in comments line by line. So please reference to that.