@@ -146,7 +146,7 @@ private Map<String, Object> traverseParams(
146
146
handleEnum (param , testOutput );
147
147
} else if (spec .getIsModel () || isCodegenModel ) {
148
148
// recursive object
149
- handleModel (paramName , param , testOutput , spec , baseType , parent , depth , isParentFreeFormObject );
149
+ handleModel (paramName , param , testOutput , spec , baseType , parent , depth , isParentFreeFormObject , isRequired != null && isRequired );
150
150
} else if (baseType .equals ("Object" )) {
151
151
// not var, no item, pure free form
152
152
handleObject (paramName , param , testOutput , true , depth );
@@ -259,7 +259,8 @@ private void handleModel(
259
259
String baseType ,
260
260
String parent ,
261
261
int depth ,
262
- boolean isParentFreeFormObject
262
+ boolean isParentFreeFormObject ,
263
+ boolean parentIsRequired
263
264
) throws CTSException {
264
265
if (!spec .getHasVars ()) {
265
266
// In this case we might have a complex `allOf`, we will first check if it exists
@@ -326,6 +327,8 @@ private void handleModel(
326
327
oneOfModel .put ("x-one-of-explicit-name" , useExplicitName );
327
328
oneOfModel .put ("hasWrapper" , isList || isString (current ) || current .getIsNumber () || current .getIsBoolean ());
328
329
testOutput .put ("oneOfModel" , oneOfModel );
330
+ // use required from the parent since oneOf don't have that property
331
+ testOutput .put ("required" , parentIsRequired );
329
332
return ;
330
333
}
331
334
0 commit comments