@@ -49,7 +49,7 @@ var _ = Describe("AllOf Flattening", func() {
49
49
By ("flattening a schema with at one branch set as Nullable" )
50
50
original := & apiext.JSONSchemaProps {
51
51
Properties : map [string ]apiext.JSONSchemaProps {
52
- "multiNullable" : apiext. JSONSchemaProps {
52
+ "multiNullable" : {
53
53
AllOf : []apiext.JSONSchemaProps {
54
54
{Nullable : true }, {Nullable : false }, {Nullable : false },
55
55
},
@@ -62,7 +62,7 @@ var _ = Describe("AllOf Flattening", func() {
62
62
By ("ensuring that the result has no branches and is nullable" )
63
63
Expect (flattened ).To (Equal (& apiext.JSONSchemaProps {
64
64
Properties : map [string ]apiext.JSONSchemaProps {
65
- "multiNullable" : apiext. JSONSchemaProps {Nullable : true },
65
+ "multiNullable" : {Nullable : true },
66
66
},
67
67
}))
68
68
})
@@ -71,7 +71,7 @@ var _ = Describe("AllOf Flattening", func() {
71
71
By ("flattening a schema with at no branches set as Nullable" )
72
72
original := & apiext.JSONSchemaProps {
73
73
Properties : map [string ]apiext.JSONSchemaProps {
74
- "multiNullable" : apiext. JSONSchemaProps {
74
+ "multiNullable" : {
75
75
AllOf : []apiext.JSONSchemaProps {
76
76
{Nullable : false }, {Nullable : false }, {Nullable : false },
77
77
},
@@ -84,7 +84,7 @@ var _ = Describe("AllOf Flattening", func() {
84
84
By ("ensuring that the result has no branches and is not nullable" )
85
85
Expect (flattened ).To (Equal (& apiext.JSONSchemaProps {
86
86
Properties : map [string ]apiext.JSONSchemaProps {
87
- "multiNullable" : apiext. JSONSchemaProps {Nullable : false },
87
+ "multiNullable" : {Nullable : false },
88
88
},
89
89
}))
90
90
})
@@ -113,7 +113,7 @@ var _ = Describe("AllOf Flattening", func() {
113
113
defOne := int64 (1 )
114
114
original := & apiext.JSONSchemaProps {
115
115
Properties : map [string ]apiext.JSONSchemaProps {
116
- "multiAdditionalProps" : apiext. JSONSchemaProps {
116
+ "multiAdditionalProps" : {
117
117
AllOf : []apiext.JSONSchemaProps {
118
118
{
119
119
AdditionalProperties : & apiext.JSONSchemaPropsOrBool {Schema : & apiext.JSONSchemaProps {
@@ -145,7 +145,7 @@ var _ = Describe("AllOf Flattening", func() {
145
145
By ("ensuring that the result has the minimal set of AllOf branches required, pushed inside AdditionalProperites" )
146
146
Expect (flattened ).To (Equal (& apiext.JSONSchemaProps {
147
147
Properties : map [string ]apiext.JSONSchemaProps {
148
- "multiAdditionalProps" : apiext. JSONSchemaProps {
148
+ "multiAdditionalProps" : {
149
149
AdditionalProperties : & apiext.JSONSchemaPropsOrBool {Schema : & apiext.JSONSchemaProps {
150
150
Nullable : true ,
151
151
MaxLength : & defSeven ,
@@ -164,7 +164,7 @@ var _ = Describe("AllOf Flattening", func() {
164
164
By ("flattening a schema with a single property with two different types" )
165
165
crd .FlattenEmbedded (& apiext.JSONSchemaProps {
166
166
Properties : map [string ]apiext.JSONSchemaProps {
167
- "multiType" : apiext. JSONSchemaProps {AllOf : []apiext.JSONSchemaProps {{Type : "string" }, {Type : "int" }}},
167
+ "multiType" : {AllOf : []apiext.JSONSchemaProps {{Type : "string" }, {Type : "int" }}},
168
168
},
169
169
}, errRec )
170
170
@@ -202,21 +202,21 @@ var _ = Describe("AllOf Flattening", func() {
202
202
AllOf : []apiext.JSONSchemaProps {
203
203
{
204
204
Properties : map [string ]apiext.JSONSchemaProps {
205
- "nonConflicting" : apiext. JSONSchemaProps {Type : "string" },
206
- "conflicting1" : apiext. JSONSchemaProps {Type : "string" , Format : "date-time" },
207
- "nonConflictingDup" : apiext. JSONSchemaProps {Type : "bool" },
205
+ "nonConflicting" : {Type : "string" },
206
+ "conflicting1" : {Type : "string" , Format : "date-time" },
207
+ "nonConflictingDup" : {Type : "bool" },
208
208
},
209
209
},
210
210
{
211
211
Properties : map [string ]apiext.JSONSchemaProps {
212
- "conflicting1" : apiext. JSONSchemaProps {Type : "string" , MinLength : & defOne },
213
- "conflicting2" : apiext. JSONSchemaProps {Type : "int" , MultipleOf : & defSeven },
212
+ "conflicting1" : {Type : "string" , MinLength : & defOne },
213
+ "conflicting2" : {Type : "int" , MultipleOf : & defSeven },
214
214
},
215
215
},
216
216
{
217
217
Properties : map [string ]apiext.JSONSchemaProps {
218
- "conflicting2" : apiext. JSONSchemaProps {Type : "int" , MultipleOf : & defEight },
219
- "nonConflictingDup" : apiext. JSONSchemaProps {Type : "bool" },
218
+ "conflicting2" : {Type : "int" , MultipleOf : & defEight },
219
+ "nonConflictingDup" : {Type : "bool" },
220
220
},
221
221
},
222
222
},
@@ -227,14 +227,14 @@ var _ = Describe("AllOf Flattening", func() {
227
227
By ("ensuring that the result has the minimal set of AllOf branches required, pushed inside Properties" )
228
228
Expect (flattened ).To (Equal (& apiext.JSONSchemaProps {
229
229
Properties : map [string ]apiext.JSONSchemaProps {
230
- "nonConflicting" : apiext. JSONSchemaProps {Type : "string" },
231
- "nonConflictingDup" : apiext. JSONSchemaProps {Type : "bool" },
232
- "conflicting1" : apiext. JSONSchemaProps {
230
+ "nonConflicting" : {Type : "string" },
231
+ "nonConflictingDup" : {Type : "bool" },
232
+ "conflicting1" : {
233
233
Type : "string" ,
234
234
Format : "date-time" ,
235
235
MinLength : & defOne ,
236
236
},
237
- "conflicting2" : apiext. JSONSchemaProps {
237
+ "conflicting2" : {
238
238
Type : "int" ,
239
239
AllOf : []apiext.JSONSchemaProps {{MultipleOf : & defSeven }, {MultipleOf : & defEight }},
240
240
},
@@ -297,9 +297,9 @@ var _ = Describe("AllOf Flattening", func() {
297
297
AllOf : []apiext.JSONSchemaProps {
298
298
{
299
299
Properties : map [string ]apiext.JSONSchemaProps {
300
- "prop1" : apiext. JSONSchemaProps {
300
+ "prop1" : {
301
301
Properties : map [string ]apiext.JSONSchemaProps {
302
- "prop2" : apiext. JSONSchemaProps {
302
+ "prop2" : {
303
303
Type : "string" ,
304
304
Pattern : "^[abc]+$" ,
305
305
},
@@ -309,9 +309,9 @@ var _ = Describe("AllOf Flattening", func() {
309
309
},
310
310
{
311
311
Properties : map [string ]apiext.JSONSchemaProps {
312
- "prop1" : apiext. JSONSchemaProps {
312
+ "prop1" : {
313
313
Properties : map [string ]apiext.JSONSchemaProps {
314
- "prop2" : apiext. JSONSchemaProps {
314
+ "prop2" : {
315
315
Pattern : "^(bc)+$" ,
316
316
},
317
317
},
@@ -326,9 +326,9 @@ var _ = Describe("AllOf Flattening", func() {
326
326
By ("ensuring that the result has the minimal AllOf branches possible" )
327
327
Expect (flattened ).To (Equal (& apiext.JSONSchemaProps {
328
328
Properties : map [string ]apiext.JSONSchemaProps {
329
- "prop1" : apiext. JSONSchemaProps {
329
+ "prop1" : {
330
330
Properties : map [string ]apiext.JSONSchemaProps {
331
- "prop2" : apiext. JSONSchemaProps {
331
+ "prop2" : {
332
332
Type : "string" ,
333
333
AllOf : []apiext.JSONSchemaProps {{Pattern : "^[abc]+$" }, {Pattern : "^(bc)+$" }},
334
334
},
0 commit comments