microsoft / kiota-java

Java libraries for Kiota-generated API clients.
https://aka.ms/kiota/docs
MIT License
27 stars 29 forks source link

Implement support for LocalDate and OffsetDateTime in RequestInformation #1586

Closed espenvis closed 1 month ago

espenvis commented 1 month ago

Implements behavior for LocalDate and OffsetDateTime in RequestInformation's getSanitizedValues. Added accompanying test for LocalDate path parameter resolution.

Edit: scope is extended to include LocalTime and PeriodAndDuration.

closes #1583

espenvis commented 1 month ago

Marking as draft until we can evaluate extending this issue to tackle time and duration amongst other types.

espenvis commented 1 month ago

Updated to include time and duration datatype support (LocalTime and PeriodAndDuration). Also merged upstream changes. The version is now bumped up to 1.5.0 and all tests pass. Let me know if I've missed something.

espenvis commented 1 month ago

Thank you for making the changes! Can you also bump std uri template to v2 so we can confirm there's no end to end regression please?

https://github.com/microsoft/kiota-java/blob/bf66598153485fea2442dcf108d00e4ff6b8ab30/components/abstractions/gradle/dependencies.gradle#L11

Yes. Apologies, I missed your earlier question.

It seems this causes an exception in UriTemplateTest.java:32 - this passes parameters directly to StdUriTemplate and will fail.

Edit: is this test appropriate? I imagine we would run the parameters through getSanitizedValues first.

baywet commented 1 month ago

@espenvis thanks for the information. I think you can remove the last line in the CSV and the date parameter in the unit test. (make sure you pull beforehand since I've applied formatting to the csv file)

espenvis commented 1 month ago

@espenvis thanks for the information. I think you can remove the last line in the CSV and the date parameter in the unit test. (make sure you pull beforehand since I've applied formatting to the csv file)

Yep, that's what I figured. I'll do that.

espenvis commented 1 month ago

Test still fails due to a JUnit error of some sort. I'll have a look.

espenvis commented 1 month ago

Seems it complained about the change in delimiter. Pushing a fix for that.