-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.Net: Fix for RestApiOperation.BuildQueryString (#6662)
### Motivation and Context We have noticed few cases where API calls were failing. Sample response: "errors":{"since_create_time":["The value '2024-05-01T00:00:00\u002B00:00' is not valid."],"before_create_time":["The value '2024-05-31T23:59:59\u002B00:00' is not valid."]}} We are passing the value correctly to SK as 2024-05-01T00:00:00+00:00 but then it’s getting transformed to '2024-05-01T00:00:00\u002B00:00 in [this code here](https://github.com/microsoft/semantic-kernel/blob/f1f53f4d9db6aa8f963a5c6a1053101774a0b49e/dotnet/src/Functions/Functions.OpenApi/Serialization/OpenApiTypeConverter.cs#L30). Then in this particular API these arguments are passed in the URL. The final URL is this: /campaigns?before_create_time=2024-05-31T23%3a59%3a59%5cu002B00%3a00&since_create_time=2024-05-01T00%3a00%3a00%5cu002B00%3a00 Now, I believe the problem is that everything would work just fine if these values were passed as the request payload to the API, where API would deserialize it correctly. But, since these are passed in URL, the value is never deserialized and stays broken. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
- Loading branch information
1 parent
c39eb1a
commit af875b6
Showing
3 changed files
with
138 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters