-
Notifications
You must be signed in to change notification settings - Fork 78
Description
Description
When using GraphMockResponsePlugin in Dev Proxy, the dates contained in the mocked JSON responses are formatted according to the operating system's regional culture settings. This causes inconsistent output across different environments. Since Dev Proxy intends to mock Microsoft Graph responses, date formats should be predictable and aligned with Microsoft Graph’s ISO-8601 conventions.
Expected behaviour
All mocked Microsoft Graph date/time fields should be serialized using a consistent culture-invariant ISO-8601 format (e.g. 2025-11-01T14:30:00Z), independent of the host machine’s locale/region settings. Like the sample response present in the documentation https://learn.microsoft.com/en-us/graph/throttling
Actual behaviour
Date/time values in mocked JSON responses vary depending on the OS regional settings. For example:
01/11/2025 14:30:00 on a French machine
11/01/2025 2:30 PM on a US machine
This leads to non-deterministic behavior.
Steps to reproduce
Configure Dev Proxy with GraphMockResponsePlugin enabled.
Run Dev Proxy on a machine with French regional settings.
Observe the different date fields in mocked responses
Run the same proxy on a machine with US regional settings.
Compare the JSON responses and note that date formats differ between environments.
Dev Proxy Version
1.3
Operating system (environment)
Windows
Shell
PowerShell
Configuration file
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.3.0/rc.schema.json",
"plugins": [
{
"name": "GraphSelectGuidancePlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
},
{
"name": "GraphBetaSupportGuidancePlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
"urlsToWatch": [
"https://graph.microsoft.com/beta/",
"https://graph.microsoft.us/beta/",
"https://dod-graph.microsoft.us/beta/",
"https://microsoftgraph.chinacloudapi.cn/beta/"
]
},
{
"name": "GraphConnectorGuidancePlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
"urlsToWatch": [
"https://graph.microsoft.com//external/connections//schema",
"https://graph.microsoft.us//external/connections//schema",
"https://dod-graph.microsoft.us//external/connections//schema",
"https://microsoftgraph.chinacloudapi.cn//external/connections//schema"
]
},
{
"name": "GraphSdkGuidancePlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
},
{
"name": "ODataPagingGuidancePlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
},
{
"name": "GraphClientRequestIdGuidancePlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
},
{
"name": "GraphRandomErrorPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
"configSection": "graphRandomErrorsPlugin"
},
{
"name": "ExecutionSummaryPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
"configSection": "executionSummaryPlugin"
}
],
"urlsToWatch": [
"https://graph.microsoft.com/v1.0/",
"https://graph.microsoft.com/beta/",
"https://graph.microsoft.us/v1.0/",
"https://graph.microsoft.us/beta/",
"https://dod-graph.microsoft.us/v1.0/",
"https://dod-graph.microsoft.us/beta/",
"https://microsoftgraph.chinacloudapi.cn/v1.0/",
"https://microsoftgraph.chinacloudapi.cn/beta/"
],
"graphRandomErrorsPlugin": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.3.0/graphrandomerrorplugin.schema.json",
"allowedErrors": [
429,
500,
502,
503,
504,
507
],
"rate": 50
},
"executionSummaryPlugin": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.3.0/executionsummaryplugin.schema.json",
"groupBy": "url"
},
"labelMode": "text",
"logLevel": "information"
}
Additional Info
No response