@@ -15,17 +15,36 @@ public class OpenApiTypeMapperTests
15
15
public static IEnumerable < object [ ] > PrimitiveTypeData => new List < object [ ] >
16
16
{
17
17
new object [ ] { typeof ( int ) , new OpenApiSchema { Type = "integer" , Format = "int32" } } ,
18
+ new object [ ] { typeof ( decimal ) , new OpenApiSchema { Type = "number" , Format = "double" } } ,
19
+ new object [ ] { typeof ( bool ? ) , new OpenApiSchema { Type = "boolean" , Nullable = true } } ,
20
+ new object [ ] { typeof ( Guid ) , new OpenApiSchema { Type = "string" , Format = "uuid" } } ,
21
+ new object [ ] { typeof ( uint ) , new OpenApiSchema { Type = "integer" , Format = "int32" } } ,
22
+ new object [ ] { typeof ( long ) , new OpenApiSchema { Type = "integer" , Format = "int64" } } ,
23
+ new object [ ] { typeof ( ulong ) , new OpenApiSchema { Type = "integer" , Format = "int64" } } ,
18
24
new object [ ] { typeof ( string ) , new OpenApiSchema { Type = "string" } } ,
19
25
new object [ ] { typeof ( double ) , new OpenApiSchema { Type = "number" , Format = "double" } } ,
20
26
new object [ ] { typeof ( float ? ) , new OpenApiSchema { Type = "number" , Format = "float" , Nullable = true } } ,
27
+ new object [ ] { typeof ( byte ? ) , new OpenApiSchema { Type = "string" , Format = "byte" , Nullable = true } } ,
28
+ new object [ ] { typeof ( int ? ) , new OpenApiSchema { Type = "integer" , Format = "int32" , Nullable = true } } ,
29
+ new object [ ] { typeof ( uint ? ) , new OpenApiSchema { Type = "integer" , Format = "int32" , Nullable = true } } ,
30
+ new object [ ] { typeof ( DateTimeOffset ? ) , new OpenApiSchema { Type = "string" , Format = "date-time" , Nullable = true } } ,
31
+ new object [ ] { typeof ( double ? ) , new OpenApiSchema { Type = "number" , Format = "double" , Nullable = true } } ,
32
+ new object [ ] { typeof ( char ? ) , new OpenApiSchema { Type = "string" , Nullable = true } } ,
21
33
new object [ ] { typeof ( DateTimeOffset ) , new OpenApiSchema { Type = "string" , Format = "date-time" } }
22
34
} ;
23
35
24
36
public static IEnumerable < object [ ] > OpenApiDataTypes => new List < object [ ] >
25
37
{
26
38
new object [ ] { new OpenApiSchema { Type = "integer" , Format = "int32" } , typeof ( int ) } ,
39
+ new object [ ] { new OpenApiSchema { Type = "number" , Format = "decimal" } , typeof ( decimal ) } ,
40
+ new object [ ] { new OpenApiSchema { Type = "number" , Format = null , Nullable = false } , typeof ( double ) } ,
27
41
new object [ ] { new OpenApiSchema { Type = "integer" , Format = null , Nullable = false } , typeof ( int ) } ,
28
42
new object [ ] { new OpenApiSchema { Type = "integer" , Format = null , Nullable = true } , typeof ( int ? ) } ,
43
+ new object [ ] { new OpenApiSchema { Type = "number" , Format = "decimal" , Nullable = true } , typeof ( decimal ? ) } ,
44
+ new object [ ] { new OpenApiSchema { Type = "number" , Format = "double" , Nullable = true } , typeof ( double ? ) } ,
45
+ new object [ ] { new OpenApiSchema { Type = "string" , Format = "date-time" , Nullable = true } , typeof ( DateTimeOffset ? ) } ,
46
+ new object [ ] { new OpenApiSchema { Type = "string" , Format = "char" , Nullable = true } , typeof ( char ? ) } ,
47
+ new object [ ] { new OpenApiSchema { Type = "string" , Format = "uuid" , Nullable = true } , typeof ( Guid ? ) } ,
29
48
new object [ ] { new OpenApiSchema { Type = "string" } , typeof ( string ) } ,
30
49
new object [ ] { new OpenApiSchema { Type = "number" , Format = "double" } , typeof ( double ) } ,
31
50
new object [ ] { new OpenApiSchema { Type = "number" , Format = "float" , Nullable = true } , typeof ( float ? ) } ,
0 commit comments