Browse Source
Support `DateOnly` and `TimeOnly` in `AspNetCoreApiDescriptionModelProvider`.
pull/17981/head
maliming
3 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
2 changed files with
10 additions and
0 deletions
-
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProvider.cs
-
framework/src/Volo.Abp.Core/Volo/Abp/Reflection/TypeHelper.cs
|
|
@ -214,6 +214,8 @@ public class AspNetCoreApiDescriptionModelProvider : IApiDescriptionModelProvide |
|
|
type == typeof(void) || |
|
|
type == typeof(void) || |
|
|
type == typeof(Enum) || |
|
|
type == typeof(Enum) || |
|
|
type == typeof(ValueType) || |
|
|
type == typeof(ValueType) || |
|
|
|
|
|
type == typeof(DateOnly) || |
|
|
|
|
|
type == typeof(TimeOnly) || |
|
|
TypeHelper.IsPrimitiveExtended(type)) |
|
|
TypeHelper.IsPrimitiveExtended(type)) |
|
|
{ |
|
|
{ |
|
|
return; |
|
|
return; |
|
|
|
|
|
@ -257,6 +257,14 @@ public static class TypeHelper |
|
|
{ |
|
|
{ |
|
|
return "string"; |
|
|
return "string"; |
|
|
} |
|
|
} |
|
|
|
|
|
else if (type.FullName == "System.DateOnly") |
|
|
|
|
|
{ |
|
|
|
|
|
return "string"; |
|
|
|
|
|
} |
|
|
|
|
|
else if (type.FullName == "System.TimeOnly") |
|
|
|
|
|
{ |
|
|
|
|
|
return "string"; |
|
|
|
|
|
} |
|
|
else if (type == typeof(TimeSpan)) |
|
|
else if (type == typeof(TimeSpan)) |
|
|
{ |
|
|
{ |
|
|
return "string"; |
|
|
return "string"; |
|
|
|