@@ -14,42 +14,42 @@ namespace KubeOps.Transpiler.Test;
14
14
public class CrdsMlcTest ( MlcProvider provider ) : TranspilerTestBase ( provider )
15
15
{
16
16
[ Theory ]
17
- [ InlineData ( typeof ( StringTestEntity ) , "string" , null , false ) ]
17
+ [ InlineData ( typeof ( StringTestEntity ) , "string" , null , null ) ]
18
18
[ InlineData ( typeof ( NullableStringTestEntity ) , "string" , null , true ) ]
19
- [ InlineData ( typeof ( IntTestEntity ) , "integer" , "int32" , false ) ]
19
+ [ InlineData ( typeof ( IntTestEntity ) , "integer" , "int32" , null ) ]
20
20
[ InlineData ( typeof ( NullableIntTestEntity ) , "integer" , "int32" , true ) ]
21
- [ InlineData ( typeof ( LongTestEntity ) , "integer" , "int64" , false ) ]
21
+ [ InlineData ( typeof ( LongTestEntity ) , "integer" , "int64" , null ) ]
22
22
[ InlineData ( typeof ( NullableLongTestEntity ) , "integer" , "int64" , true ) ]
23
- [ InlineData ( typeof ( FloatTestEntity ) , "number" , "float" , false ) ]
23
+ [ InlineData ( typeof ( FloatTestEntity ) , "number" , "float" , null ) ]
24
24
[ InlineData ( typeof ( NullableFloatTestEntity ) , "number" , "float" , true ) ]
25
- [ InlineData ( typeof ( DecimalTestEntity ) , "number" , "decimal" , false ) ]
25
+ [ InlineData ( typeof ( DecimalTestEntity ) , "number" , "decimal" , null ) ]
26
26
[ InlineData ( typeof ( NullableDecimalTestEntity ) , "number" , "decimal" , true ) ]
27
- [ InlineData ( typeof ( DoubleTestEntity ) , "number" , "double" , false ) ]
27
+ [ InlineData ( typeof ( DoubleTestEntity ) , "number" , "double" , null ) ]
28
28
[ InlineData ( typeof ( NullableDoubleTestEntity ) , "number" , "double" , true ) ]
29
- [ InlineData ( typeof ( BoolTestEntity ) , "boolean" , null , false ) ]
29
+ [ InlineData ( typeof ( BoolTestEntity ) , "boolean" , null , null ) ]
30
30
[ InlineData ( typeof ( NullableBoolTestEntity ) , "boolean" , null , true ) ]
31
- [ InlineData ( typeof ( DateTimeTestEntity ) , "string" , "date-time" , false ) ]
31
+ [ InlineData ( typeof ( DateTimeTestEntity ) , "string" , "date-time" , null ) ]
32
32
[ InlineData ( typeof ( NullableDateTimeTestEntity ) , "string" , "date-time" , true ) ]
33
- [ InlineData ( typeof ( DateTimeOffsetTestEntity ) , "string" , "date-time" , false ) ]
33
+ [ InlineData ( typeof ( DateTimeOffsetTestEntity ) , "string" , "date-time" , null ) ]
34
34
[ InlineData ( typeof ( NullableDateTimeOffsetTestEntity ) , "string" , "date-time" , true ) ]
35
- [ InlineData ( typeof ( V1ObjectMetaTestEntity ) , "object" , null , false ) ]
36
- [ InlineData ( typeof ( StringArrayEntity ) , "array" , null , false ) ]
35
+ [ InlineData ( typeof ( V1ObjectMetaTestEntity ) , "object" , null , null ) ]
36
+ [ InlineData ( typeof ( StringArrayEntity ) , "array" , null , null ) ]
37
37
[ InlineData ( typeof ( NullableStringArrayEntity ) , "array" , null , true ) ]
38
- [ InlineData ( typeof ( EnumerableIntEntity ) , "array" , null , false ) ]
39
- [ InlineData ( typeof ( HashSetIntEntity ) , "array" , null , false ) ]
40
- [ InlineData ( typeof ( SetIntEntity ) , "array" , null , false ) ]
41
- [ InlineData ( typeof ( InheritedEnumerableEntity ) , "array" , null , false ) ]
42
- [ InlineData ( typeof ( EnumEntity ) , "string" , null , false ) ]
38
+ [ InlineData ( typeof ( EnumerableIntEntity ) , "array" , null , null ) ]
39
+ [ InlineData ( typeof ( HashSetIntEntity ) , "array" , null , null ) ]
40
+ [ InlineData ( typeof ( SetIntEntity ) , "array" , null , null ) ]
41
+ [ InlineData ( typeof ( InheritedEnumerableEntity ) , "array" , null , null ) ]
42
+ [ InlineData ( typeof ( EnumEntity ) , "string" , null , null ) ]
43
43
[ InlineData ( typeof ( NullableEnumEntity ) , "string" , null , true ) ]
44
- [ InlineData ( typeof ( DictionaryEntity ) , "object" , null , false ) ]
45
- [ InlineData ( typeof ( EnumerableKeyPairsEntity ) , "object" , null , false ) ]
46
- [ InlineData ( typeof ( IntstrOrStringEntity ) , null , null , false ) ]
47
- [ InlineData ( typeof ( EmbeddedResourceEntity ) , "object" , null , false ) ]
48
- [ InlineData ( typeof ( EmbeddedCustomResourceEntity ) , "object" , null , false ) ]
49
- [ InlineData ( typeof ( EmbeddedCustomResourceGenericEntity ) , "object" , null , false ) ]
50
- [ InlineData ( typeof ( EmbeddedResourceListEntity ) , "array" , null , false ) ]
44
+ [ InlineData ( typeof ( DictionaryEntity ) , "object" , null , null ) ]
45
+ [ InlineData ( typeof ( EnumerableKeyPairsEntity ) , "object" , null , null ) ]
46
+ [ InlineData ( typeof ( IntstrOrStringEntity ) , null , null , null ) ]
47
+ [ InlineData ( typeof ( EmbeddedResourceEntity ) , "object" , null , null ) ]
48
+ [ InlineData ( typeof ( EmbeddedCustomResourceEntity ) , "object" , null , null ) ]
49
+ [ InlineData ( typeof ( EmbeddedCustomResourceGenericEntity ) , "object" , null , null ) ]
50
+ [ InlineData ( typeof ( EmbeddedResourceListEntity ) , "array" , null , null ) ]
51
51
public void Should_Transpile_Entity_Type_Correctly ( Type type , string ? expectedType , string ? expectedFormat ,
52
- bool isNullable )
52
+ bool ? isNullable )
53
53
{
54
54
var crd = _mlc . Transpile ( type ) ;
55
55
var prop = crd . Spec . Versions . First ( ) . Schema . OpenAPIV3Schema . Properties [ "property" ] ;
@@ -59,15 +59,15 @@ public void Should_Transpile_Entity_Type_Correctly(Type type, string? expectedTy
59
59
}
60
60
61
61
[ Theory ]
62
- [ InlineData ( typeof ( StringArrayEntity ) , "string" , false ) ]
63
- [ InlineData ( typeof ( NullableStringArrayEntity ) , "string" , false ) ]
64
- [ InlineData ( typeof ( EnumerableIntEntity ) , "integer" , false ) ]
62
+ [ InlineData ( typeof ( StringArrayEntity ) , "string" , null ) ]
63
+ [ InlineData ( typeof ( NullableStringArrayEntity ) , "string" , null ) ]
64
+ [ InlineData ( typeof ( EnumerableIntEntity ) , "integer" , null ) ]
65
65
[ InlineData ( typeof ( EnumerableNullableIntEntity ) , "integer" , true ) ]
66
- [ InlineData ( typeof ( HashSetIntEntity ) , "integer" , false ) ]
67
- [ InlineData ( typeof ( SetIntEntity ) , "integer" , false ) ]
68
- [ InlineData ( typeof ( InheritedEnumerableEntity ) , "integer" , false ) ]
69
- [ InlineData ( typeof ( EmbeddedResourceListEntity ) , "object" , false ) ]
70
- public void Should_Set_Correct_Array_Type ( Type type , string expectedType , bool isNullable )
66
+ [ InlineData ( typeof ( HashSetIntEntity ) , "integer" , null ) ]
67
+ [ InlineData ( typeof ( SetIntEntity ) , "integer" , null ) ]
68
+ [ InlineData ( typeof ( InheritedEnumerableEntity ) , "integer" , null ) ]
69
+ [ InlineData ( typeof ( EmbeddedResourceListEntity ) , "object" , null ) ]
70
+ public void Should_Set_Correct_Array_Type ( Type type , string expectedType , bool ? isNullable )
71
71
{
72
72
var crd = _mlc . Transpile ( type ) ;
73
73
var prop = crd . Spec . Versions . First ( ) . Schema . OpenAPIV3Schema . Properties [ "property" ] . Items as V1JSONSchemaProps ;
@@ -76,9 +76,9 @@ public void Should_Set_Correct_Array_Type(Type type, string expectedType, bool i
76
76
}
77
77
78
78
[ Theory ]
79
- [ InlineData ( typeof ( DictionaryEntity ) , "string" , false ) ]
80
- [ InlineData ( typeof ( EnumerableKeyPairsEntity ) , "string" , false ) ]
81
- public void Should_Set_Correct_Dictionary_Additional_Properties_Type ( Type type , string expectedType , bool isNullable )
79
+ [ InlineData ( typeof ( DictionaryEntity ) , "string" , null ) ]
80
+ [ InlineData ( typeof ( EnumerableKeyPairsEntity ) , "string" , null ) ]
81
+ public void Should_Set_Correct_Dictionary_Additional_Properties_Type ( Type type , string expectedType , bool ? isNullable )
82
82
{
83
83
var crd = _mlc . Transpile ( type ) ;
84
84
var prop = crd . Spec . Versions . First ( ) . Schema . OpenAPIV3Schema . Properties [ "property" ] . AdditionalProperties as V1JSONSchemaProps ;
0 commit comments