Merge pull request #17981 from abpframework/DateOnly

Support `DateOnly` and `TimeOnly` in `AspNetCoreApiDescriptionModelProvider`.
pull/17993/head
Masum ULU 1 year ago committed by GitHub
commit 29676a4f8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -214,6 +214,8 @@ public class AspNetCoreApiDescriptionModelProvider : IApiDescriptionModelProvide
type == typeof(void) ||
type == typeof(Enum) ||
type == typeof(ValueType) ||
type == typeof(DateOnly) ||
type == typeof(TimeOnly) ||
TypeHelper.IsPrimitiveExtended(type))
{
return;

@ -257,6 +257,14 @@ public static class TypeHelper
{
return "string";
}
else if (type.FullName == "System.DateOnly")
{
return "string";
}
else if (type.FullName == "System.TimeOnly")
{
return "string";
}
else if (type == typeof(TimeSpan))
{
return "string";

@ -5,6 +5,8 @@ export const SYSTEM_TYPES = new Map([
['Collections.Generic.Dictionary', 'Record'],
['DateTime', 'string'],
['DateTimeOffset', 'string'],
['DateOnly', 'string'],
['TimeOnly', 'string'],
['Decimal', 'number'],
['Double', 'number'],
['Guid', 'string'],

Loading…
Cancel
Save