-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC 3339 + Python #352
Comments
This looks to be a valid RFC outcome, but it needs |
I'm going to debug shortly and see if i can find the line of the python lib which may need reviewing. According to the spec timezone+Z is invalid. |
Hi @pjmagee Let's use RFC3339 moving forward in this discussion since it's the standard that OAS uses If I understand your issue properly:
Does that reflect the situation properly? If so, I've transferred this issue to the Python serialization repository, this is most likely caused by this block Unit tests are implemented here (but only for the string type). Is this something you'd like to submit a pull request for provided some guidance? |
Yes, this seems to be what i find occurring. I also am using I am happy to try and raise a PR, similar to the other date issue i fixed a while back. |
Let us know if you have any additional comments or questions. |
I think i found the bug.... It's from
This Z is forced, this is not RFC 3339 Compliant. I think the fix is:
|
Thank you for the additional information. There are effectively multiple places where the format of a date time matters:
As a general rule of thumb: kiota client should try to normalize URI parameters as much as it can before sending it down to std uri template. This is because we have more context and dependencies than this lib has and can handle more data types it can. We should also strive to have the same implementation for date time across abstractions and serialization implementations to achieve maximal consistency. |
Hello, currently overloaded but I will try to find some time end of week to test this :) Thanks for working on it behind the scenes. I know bigger changes were needed to solve this issue |
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. |
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. |
What are you generating using Kiota, clients or plugins?
API Client/SDK
In what context or format are you using Kiota?
Nuget tool
Client library/SDK language
Python
Describe the bug
Python Serialized date: 2024-09-11T03:33:16+00:00Z
Link to Microsoft ISO/RFC 3339 for .NET:
When the Python SDK sends a request to an API using .NET
System.Text.Json
to Parse and validate RFC 3339 from a Kiota Python SDK datetime, it cannot deserialize the datetime.If the Python code omitted the Z at the end, it would be valid because including the
+00:00
timezone already means its UTC.From the Microsoft page on RFC Parsing (for .NET at least)
Check the link on RFC 3339 section 5.6:
https://datatracker.ietf.org/doc/html/rfc3339#section-5.6
It states
Z OR time-numoffset
Expected behavior
2024-09-11T03:33:16+00:00Z
should be serialised as2024-09-11T03:33:16+00:00
How to reproduce
Any openapi spec with a
datetime
sent to a server to parse RFC 3339 datetime.Using .NET System.Text.Json RFC 3339 Support
Open API description file
No response
Kiota Version
1.18.0
Latest Kiota version known to work for scenario above?(Not required)
No response
Known Workarounds
No response
Configuration
No response
Debug output
Click to expand log
```The text was updated successfully, but these errors were encountered: