diff --git a/openapi-core/src/main/java/io/ballerina/openapi/core/generators/type/generators/AllOfRecordTypeGenerator.java b/openapi-core/src/main/java/io/ballerina/openapi/core/generators/type/generators/AllOfRecordTypeGenerator.java index 2b95df5f5..e014d2b4d 100644 --- a/openapi-core/src/main/java/io/ballerina/openapi/core/generators/type/generators/AllOfRecordTypeGenerator.java +++ b/openapi-core/src/main/java/io/ballerina/openapi/core/generators/type/generators/AllOfRecordTypeGenerator.java @@ -163,7 +163,7 @@ private ImmutablePair, List>> generateAllOfRecordFields(Lis typeRef, createToken(SEMICOLON_TOKEN)); // check whether given reference schema has additional fields. OpenAPI openAPI = GeneratorMetaData.getInstance().getOpenAPI(); - Schema refSchema = openAPI.getComponents().getSchemas().get(modifiedSchemaName); + Schema refSchema = openAPI.getComponents().getSchemas().get(extractedSchemaName); addAdditionalSchemas(refSchema); if (!pregeneratedTypeMap.containsKey(modifiedSchemaName)) {