diff --git a/src/AutoRest.CSharp/Common/Output/Builders/BuilderHelpers.cs b/src/AutoRest.CSharp/Common/Output/Builders/BuilderHelpers.cs index bebf647746d..f00d68e7050 100644 --- a/src/AutoRest.CSharp/Common/Output/Builders/BuilderHelpers.cs +++ b/src/AutoRest.CSharp/Common/Output/Builders/BuilderHelpers.cs @@ -89,6 +89,11 @@ public static Constant ParseConstant(object? value, CSharpType type) _ => SerializationFormat.Duration_ISO8601 }, + _ when schema.Type == AllSchemaTypes.Duration => SerializationFormat.Duration_ISO8601, + _ when schema.Type == AllSchemaTypes.DateTime => SerializationFormat.DateTime_ISO8601, + _ when schema.Type == AllSchemaTypes.Date => SerializationFormat.DateTime_ISO8601, + _ when schema.Type == AllSchemaTypes.Time => SerializationFormat.DateTime_ISO8601, + _ => schema.Extensions?.Format switch { XMsFormat.DateTime => SerializationFormat.DateTime_ISO8601,