microsoft / kiota-dotnet

Abstractions library for the Kiota generated SDKs in dotnet
https://aka.ms/kiota/docs
MIT License
32 stars 29 forks source link

Provide JsonConverter implementations #282

Closed ajtribick closed 1 month ago

ajtribick commented 2 months ago

Kiota uses custom enum serialization that depends on the EnumMemberAttribute. Unfortunately the JsonStringEnumConverter provided in System.Text.Json does not use this attribute. In order to more easily integrate with non-Kiota uses of System.Text.Json, it would be useful to provide JsonConverter/JsonConverterFactory implementations that match the Kiota output.

Similarly the Date and Time types from Kiota abstractions also don't work directly with System.Text.Json.

andrueastman commented 2 months ago

Transferring issue as part of https://github.com/microsoft/kiota-abstractions-dotnet/issues/238

andrueastman commented 2 months ago

Thanks for raising this @ajtribick

At the moment, the library provides mechanisms for deserializing/serializing with the helper methods as documented at the link below.

https://learn.microsoft.com/en-us/openapi/kiota/serialization?tabs=csharp#serialization-helpers

Any chance you can provide more information as to how the intergration with non Kiota uses would be hindered?

microsoft-github-policy-service[bot] commented 1 month ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.