@@ -389,7 +389,7 @@ private HashMap<String, Object> processComplexBodyAndMatchers(
389389 } else {
390390 final var subProperties = ((ArraySchema ) openAPI .getComponents ().getSchemas ().get (ref )).getItems ();
391391 final List <Object > propertyList = new ArrayList <>();
392- propertyMap .put (property .getKey (), processArray (subProperties , propertyList , newObjectName , bodyMatchers , openAPI ));
392+ propertyMap .put (property .getKey (), processArray (subProperties , propertyList , objectName , bodyMatchers , openAPI ));
393393 }
394394 } else {
395395 final String type ;
@@ -409,7 +409,7 @@ private List<Object> processArray(final Schema<?> arraySchema, final List<Object
409409 if (Objects .nonNull (arraySchema .get$ref ())) {
410410 final String ref = OpenApiContractConverterUtils .mapRefName (arraySchema );
411411 final HashMap <String , Schema > subObject = (HashMap <String , Schema >) openAPI .getComponents ().getSchemas ().get (ref ).getProperties ();
412- propertyList .add (processComplexBodyAndMatchers ("[0]" , subObject , openAPI , bodyMatchers ));
412+ propertyList .add (processComplexBodyAndMatchers (objectName , subObject , openAPI , bodyMatchers ));
413413 } else {
414414 final String type = arraySchema .getType ();
415415 switch (type ) {
@@ -441,7 +441,7 @@ private List<Object> processArray(final Schema<?> arraySchema, final List<Object
441441
442442 private void processObjectArray (final Schema <?> arraySchema , final List <Object > propertyList , final String objectName , final BodyMatchers bodyMatchers , final OpenAPI openAPI ) {
443443 final HashMap <String , Schema > subObject = (HashMap <String , Schema >) arraySchema .getProperties ();
444- propertyList .add (processComplexBodyAndMatchers (objectName + "[0]" , subObject , openAPI , bodyMatchers ));
444+ propertyList .add (processComplexBodyAndMatchers (objectName , subObject , openAPI , bodyMatchers ));
445445 }
446446
447447 private void processArrayArray (final ArraySchema arraySchema , final List <Object > propertyList , final String objectName , final BodyMatchers bodyMatchers , final OpenAPI openAPI ) {
@@ -450,7 +450,7 @@ private void processArrayArray(final ArraySchema arraySchema, final List<Object>
450450 propertyList .add (subArray .getExample ());
451451 } else {
452452 final List <Object > subPropertyList = new ArrayList <>();
453- propertyList .add (processArray (subArray , subPropertyList , objectName , bodyMatchers , openAPI ));
453+ propertyList .add (processArray (subArray , subPropertyList , objectName + "[0]" , bodyMatchers , openAPI ));
454454 }
455455 }
456456
0 commit comments