diff --git a/src/Microsoft.OpenApi.CSharpAnnotations.DocumentGeneration/Extensions/TypeExtensions.cs b/src/Microsoft.OpenApi.CSharpAnnotations.DocumentGeneration/Extensions/TypeExtensions.cs index 42173e0..3141143 100644 --- a/src/Microsoft.OpenApi.CSharpAnnotations.DocumentGeneration/Extensions/TypeExtensions.cs +++ b/src/Microsoft.OpenApi.CSharpAnnotations.DocumentGeneration/Extensions/TypeExtensions.cs @@ -31,6 +31,7 @@ public static class TypeExtensions [typeof(decimal)] = () => new OpenApiSchema {Type = "number", Format = "double"}, [typeof(DateTime)] = () => new OpenApiSchema {Type = "string", Format = "date-time"}, [typeof(DateTimeOffset)] = () => new OpenApiSchema {Type = "string", Format = "date-time"}, + [typeof(TimeSpan)] = () => new OpenApiSchema {Type = "string"}, [typeof(Guid)] = () => new OpenApiSchema {Type = "string", Format = "uuid"}, [typeof(char)] = () => new OpenApiSchema {Type = "string"}, @@ -45,6 +46,7 @@ public static class TypeExtensions [typeof(double?)] = () => new OpenApiSchema {Type = "number", Format = "double", Nullable = true}, [typeof(decimal?)] = () => new OpenApiSchema {Type = "number", Format = "double", Nullable = true}, [typeof(DateTime?)] = () => new OpenApiSchema {Type = "string", Format = "date-time", Nullable = true}, + [typeof(TimeSpan?)] = () => new OpenApiSchema {Type = "string", Nullable = true}, [typeof(DateTimeOffset?)] = () => new OpenApiSchema {Type = "string", Format = "date-time", Nullable = true}, [typeof(Guid?)] = () => new OpenApiSchema {Type = "string", Format = "uuid", Nullable = true},