Product team have fixed the issue and this changes will be included in the next release, which will likely start rolling out in July and finish in late July or in August.
Updated: The issue is fixed now.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi, During the switch in our project of backend validation to Azure API-Management JSON validate-content we encountered a bug. When the request body includes a datetime such as "timestamp":"2020-06-19T12:54:40.180Z" the trailing 0 milliseconds are being truncated/trimmed.
Our project applies a strict format yyyy-MM-dd'T'HH:mm:ss.SSS'Z' so none of our implementations expect missing milliseconds nor do our 3rd parties when we forward events (JSON payloads) Rewriting the body (set-body policy) with the following expression does not fix the DateTime parsing. I'm sure that there is DateTime parsing ongoing when the validate-content policy is executed. The parsing needs to be an option.
Can someone give me some insights either on how to resolve it or confirm this is an ongoing bug.
<set-header name="Content-Type" exists-action="override">
<value>application/json</value>
</set-header>
<set-body>@{ var body = context.Request.Body.AsJObject(true,new JsonSerializerSettings() { DateParseHandling = DateParseHandling.None }); return JsonConvert.SerializeObject(body); }</set-body>
<validate-content unspecified-content-type-action="prevent" max-size="128" size-exceeded-action="ignore" errors-variable-name="validname">
<content type="application/json" validate-as="json" action="prevent" />
</validate-content>
References:
Out of scope: I'm sure that the same bug happens whenever you send JSON timestamps through an eventgrid. Thanks to all from the community for participating.
Product team have fixed the issue and this changes will be included in the next release, which will likely start rolling out in July and finish in late July or in August.
Updated: The issue is fixed now.