@@ -14,42 +14,42 @@ namespace KubeOps.Transpiler.Test;
1414public class CrdsMlcTest ( MlcProvider provider ) : TranspilerTestBase ( provider )
1515{
1616 [ Theory ]
17- [ InlineData ( typeof ( StringTestEntity ) , "string" , null , false ) ]
17+ [ InlineData ( typeof ( StringTestEntity ) , "string" , null , null ) ]
1818 [ InlineData ( typeof ( NullableStringTestEntity ) , "string" , null , true ) ]
19- [ InlineData ( typeof ( IntTestEntity ) , "integer" , "int32" , false ) ]
19+ [ InlineData ( typeof ( IntTestEntity ) , "integer" , "int32" , null ) ]
2020 [ InlineData ( typeof ( NullableIntTestEntity ) , "integer" , "int32" , true ) ]
21- [ InlineData ( typeof ( LongTestEntity ) , "integer" , "int64" , false ) ]
21+ [ InlineData ( typeof ( LongTestEntity ) , "integer" , "int64" , null ) ]
2222 [ InlineData ( typeof ( NullableLongTestEntity ) , "integer" , "int64" , true ) ]
23- [ InlineData ( typeof ( FloatTestEntity ) , "number" , "float" , false ) ]
23+ [ InlineData ( typeof ( FloatTestEntity ) , "number" , "float" , null ) ]
2424 [ InlineData ( typeof ( NullableFloatTestEntity ) , "number" , "float" , true ) ]
25- [ InlineData ( typeof ( DecimalTestEntity ) , "number" , "decimal" , false ) ]
25+ [ InlineData ( typeof ( DecimalTestEntity ) , "number" , "decimal" , null ) ]
2626 [ InlineData ( typeof ( NullableDecimalTestEntity ) , "number" , "decimal" , true ) ]
27- [ InlineData ( typeof ( DoubleTestEntity ) , "number" , "double" , false ) ]
27+ [ InlineData ( typeof ( DoubleTestEntity ) , "number" , "double" , null ) ]
2828 [ InlineData ( typeof ( NullableDoubleTestEntity ) , "number" , "double" , true ) ]
29- [ InlineData ( typeof ( BoolTestEntity ) , "boolean" , null , false ) ]
29+ [ InlineData ( typeof ( BoolTestEntity ) , "boolean" , null , null ) ]
3030 [ InlineData ( typeof ( NullableBoolTestEntity ) , "boolean" , null , true ) ]
31- [ InlineData ( typeof ( DateTimeTestEntity ) , "string" , "date-time" , false ) ]
31+ [ InlineData ( typeof ( DateTimeTestEntity ) , "string" , "date-time" , null ) ]
3232 [ InlineData ( typeof ( NullableDateTimeTestEntity ) , "string" , "date-time" , true ) ]
33- [ InlineData ( typeof ( DateTimeOffsetTestEntity ) , "string" , "date-time" , false ) ]
33+ [ InlineData ( typeof ( DateTimeOffsetTestEntity ) , "string" , "date-time" , null ) ]
3434 [ 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 ) ]
3737 [ 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 ) ]
4343 [ 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 ) ]
5151 public void Should_Transpile_Entity_Type_Correctly ( Type type , string ? expectedType , string ? expectedFormat ,
52- bool isNullable )
52+ bool ? isNullable )
5353 {
5454 var crd = _mlc . Transpile ( type ) ;
5555 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
5959 }
6060
6161 [ 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 ) ]
6565 [ 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 )
7171 {
7272 var crd = _mlc . Transpile ( type ) ;
7373 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
7676 }
7777
7878 [ 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 )
8282 {
8383 var crd = _mlc . Transpile ( type ) ;
8484 var prop = crd . Spec . Versions . First ( ) . Schema . OpenAPIV3Schema . Properties [ "property" ] . AdditionalProperties as V1JSONSchemaProps ;
0 commit comments