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