microsoft / kiota

OpenAPI based HTTP Client code generator
https://aka.ms/kiota/docs
MIT License
3.02k stars 210 forks source link

C# project targeting netstandard2.0 generates clients with DateOnly data type (.NET 6+) in indexers #5201

Closed thom0707 closed 3 months ago

thom0707 commented 3 months ago

Discussed in https://github.com/microsoft/kiota/discussions/5186

Originally posted by **thom0707** August 19, 2024 When targeting `netstandard2.0`, Kiota can generate C# clients with the `DateOnly` data type which was introduced in .NET 6, resulting in a project that fails to build. This only seems to appear in generated indexers. The incoming data format from the OpenAPI specification must also be "date". Reproduced here: kiota-test [repo](https://github.com/thom0707/kiota-test). [Example of DateOnly](https://github.com/thom0707/kiota-test/blob/e45e9101a353ae5c33a6a8a770173f11f444008b/Client/Events/EventsRequestBuilder.cs#L20C1-L20C9)
baywet commented 3 months ago

Thanks for creating the issue after our discussion. Since you're already offer to put a PR together on the discussion, I went ahead and assigned it to you for the time being. Let us know if you have any additional comments or questions.