From 6a473c5124bf70943a59cca0c9ee1f831d92bde4 Mon Sep 17 00:00:00 2001 From: lnash94 Date: Tue, 30 Apr 2024 14:11:07 +0530 Subject: [PATCH] Fix NPE issue --- .../generators/type/generators/AllOfRecordTypeGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) {