microsoft / microsoft/Power-Fx
DateTime format issue in HttpFunctionInvoker
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.4k
- Forks
- 358
- Avg merge
- 10h 34m
- Merged PRs (30d)
- 3
Description
When connector expect a date-time type parameters in the query. They expected a UTC format.
{
"name": "startTime",
"in": "query",
"x-ms-summary": "From Start Time",
"description": "yyyy-MM-ddTHH:mm:ss.fffZ (UTC format)",
"required": false,
"x-ms-visibility": "advanced",
"type": "string",
"format": "date-time",
"x-ms-test-value": "2017-07-23T07:00:00Z"
}
But current paramValue?.ToObject()?.ToString() will generate a format like "3/31/2025 2:15:42 PM". which cause error in connector server side.
Ideally, we should reuse use _writer.WriteStringValue(dateTimeValue.ToString(UtcDateTimeFormat, CultureInfo.InvariantCulture));
Linked workitem: DateTime type mismatch
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/libraries/Microsoft.PowerFx.Connectors/Execution/HttpFunctionInvoker.cs at the parameter conversion linked in the issue, then compare it with OpenApiJsonSerializer.cs and its UTC date-time formatting. Done means date-time query parameters are serialized in the expected UTC format instead of the culture-dependent string shown in the report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100