@@ -14,19 +14,22 @@ public class OpenApiTypeMapperTests
1414    { 
1515        public  static IEnumerable < object [ ] >  PrimitiveTypeData  =>  new  List < object [ ] > 
1616        { 
17-             new  object [ ]  {  typeof ( int ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Integer ,  Format  =  "int32"  }  } , 
17+             new  object [ ]  {  typeof ( int ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "int32"  }  } , 
1818            new  object [ ]  {  typeof ( decimal ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "double"  }  } , 
19+             new  object [ ]  {  typeof ( decimal ? ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "double" ,  Nullable  =  true  }  } , 
1920            new  object [ ]  {  typeof ( bool ? ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Boolean ,  Nullable  =  true  }  } , 
2021            new  object [ ]  {  typeof ( Guid ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . String ,  Format  =  "uuid"  }  } , 
21-             new  object [ ]  {  typeof ( uint ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Integer ,  Format  =  "int32"  }  } , 
22-             new  object [ ]  {  typeof ( long ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Integer ,  Format  =  "int64"  }  } , 
23-             new  object [ ]  {  typeof ( ulong ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Integer ,  Format  =  "int64"  }  } , 
22+             new  object [ ]  {  typeof ( Guid ? ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . String ,  Format  =  "uuid" ,  Nullable  =  true  }  } , 
23+             new  object [ ]  {  typeof ( uint ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "int32"  }  } , 
24+             new  object [ ]  {  typeof ( long ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "int64"  }  } , 
25+             new  object [ ]  {  typeof ( long ? ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "int64" ,  Nullable  =  true  }  } , 
26+             new  object [ ]  {  typeof ( ulong ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "int64"  }  } , 
2427            new  object [ ]  {  typeof ( string ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . String  }  } , 
2528            new  object [ ]  {  typeof ( double ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "double"  }  } , 
2629            new  object [ ]  {  typeof ( float ? ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "float" ,  Nullable  =  true  }  } , 
2730            new  object [ ]  {  typeof ( byte ? ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . String ,  Format  =  "byte" ,  Nullable  =  true  }  } , 
28-             new  object [ ]  {  typeof ( int ? ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Integer ,  Format  =  "int32" ,  Nullable  =  true  }  } , 
29-             new  object [ ]  {  typeof ( uint ? ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Integer ,  Format  =  "int32" ,  Nullable  =  true  }  } , 
31+             new  object [ ]  {  typeof ( int ? ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "int32" ,  Nullable  =  true  }  } , 
32+             new  object [ ]  {  typeof ( uint ? ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "int32" ,  Nullable  =  true  }  } , 
3033            new  object [ ]  {  typeof ( DateTimeOffset ? ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . String ,  Format  =  "date-time" ,  Nullable  =  true  }  } , 
3134            new  object [ ]  {  typeof ( double ? ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "double" ,  Nullable  =  true  }  } , 
3235            new  object [ ]  {  typeof ( char ? ) ,  new  OpenApiSchema  {  Type  =  JsonSchemaType . String ,  Nullable  =  true  }  } , 
@@ -35,11 +38,15 @@ public class OpenApiTypeMapperTests
3538
3639        public  static IEnumerable < object [ ] >  OpenApiDataTypes  =>  new  List < object [ ] > 
3740        { 
38-             new  object [ ]  {  new  OpenApiSchema  {  Type  =  JsonSchemaType . Integer ,  Format  =  "int32" } ,  typeof ( int )  } , 
41+             new  object [ ]  {  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "int32" ,  Nullable  =  false } ,  typeof ( int )  } , 
42+             new  object [ ]  {  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "int32" ,  Nullable  =  true } ,  typeof ( int ? )  } , 
43+             new  object [ ]  {  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "int64" ,  Nullable  =  false } ,  typeof ( long )  } , 
44+             new  object [ ]  {  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "int64" ,  Nullable  =  true } ,  typeof ( long ? )  } , 
3945            new  object [ ]  {  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "decimal" } ,  typeof ( decimal )  } , 
46+             new  object [ ]  {  new  OpenApiSchema  {  Type  =  JsonSchemaType . Integer ,  Format  =  null ,  Nullable  =  false } ,  typeof ( long )  } , 
47+             new  object [ ]  {  new  OpenApiSchema  {  Type  =  JsonSchemaType . Integer ,  Format  =  null ,  Nullable  =  true } ,  typeof ( long ? )  } , 
4048            new  object [ ]  {  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  null ,  Nullable  =  false } ,  typeof ( double )  } , 
41-             new  object [ ]  {  new  OpenApiSchema  {  Type  =  JsonSchemaType . Integer ,  Format  =  null ,  Nullable  =  false } ,  typeof ( int )  } , 
42-             new  object [ ]  {  new  OpenApiSchema  {  Type  =  JsonSchemaType . Integer ,  Format  =  null ,  Nullable  =  true } ,  typeof ( int ? )  } , 
49+             new  object [ ]  {  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  null ,  Nullable  =  true } ,  typeof ( double ? )  } , 
4350            new  object [ ]  {  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "decimal" ,  Nullable  =  true } ,  typeof ( decimal ? )  } , 
4451            new  object [ ]  {  new  OpenApiSchema  {  Type  =  JsonSchemaType . Number ,  Format  =  "double" ,  Nullable  =  true } ,  typeof ( double ? )  } , 
4552            new  object [ ]  {  new  OpenApiSchema  {  Type  =  JsonSchemaType . String ,  Format  =  "date-time" ,  Nullable  =  true } ,  typeof ( DateTimeOffset ? )  } , 
0 commit comments