Repository: ballerina-platform/openapi-tools
Issue: vscode `try it` command not working for record type payload parameters

**Description:**
$subject 

**Steps to reproduce:**
Please try to run `try it` code lense for below bal service. `try it` windows is not loading and does not display any error message. 

```bal
import ballerina/http;

type Album readonly & record {|
    string title;
    string artist;
|};

table<Album> key(title) albums = table [];

service / on new http:Listener(9090) {

    // The `album` parameter in the payload annotation represents the entity body of the inbound request.
    resource function post albums(Album album) returns Album {
        albums.add(album);
        return album;
    }
}
```

**Affected Versions:**
2201.7.2 RC pack

**OS, DB, other environment details and versions:**

**Related Issues (optional):**
<!-- Any related issues such as sub tasks, issues reported in other repositories (e.g component repositories), similar problems, etc. -->

**Suggested Labels (optional):**
<!-- Optional comma separated list of suggested labels. Non committers can’t assign labels to issues, so this will help issue creators who are not a committer to suggest possible labels-->

**Suggested Assignees (optional):**
<!--Optional comma separated list of suggested team members who should attend the issue. Non committers can’t assign issues to assignees, so this will help issue creators who are not a committer to suggest possible assignees-->


Changed files:
openapi-ls-extension/src/main/java/io/ballerina/openapi/extension/OpenAPIConverterService.java

diff --git a/openapi-ls-extension/src/main/java/io/ballerina/openapi/extension/OpenAPIConverterService.java b/openapi-ls-extension/src/main/java/io/ballerina/openapi/extension/OpenAPIConverterService.java
index f374a819..58e9ffb0 100644
--- a/openapi-ls-extension/src/main/java/io/ballerina/openapi/extension/OpenAPIConverterService.java
+++ b/openapi-ls-extension/src/main/java/io/ballerina/openapi/extension/OpenAPIConverterService.java
@@ -127,22 +127,22 @@ public class OpenAPIConverterService implements ExtendedLanguageServerService {
             OpenAPIConverterResponse response = new OpenAPIConverterResponse();
             Path filePath = Path.of(request.getDocumentFilePath());
             Optional<SemanticModel> semanticModel = workspaceManager.semanticModel(filePath);
-            Optional<Project> module = workspaceManager.project(filePath);
+            Optional<Project> project = workspaceManager.project(filePath);
             if (semanticModel.isEmpty()) {
                 response.setError("Error while generating semantic model.");
                 return response;
             }
-            if (module.isEmpty()) {
+            if (project.isEmpty()) {
                 response.setError("Error while getting the project.");
                 return response;
             }
-            module = Optional.of(module.get().duplicate());
-            DiagnosticResult diagnosticsFromCodeGenAndModify = module.get()
+            project = Optional.of(project.get().duplicate());
+            DiagnosticResult diagnosticsFromCodeGenAndModify = project.get()
                     .currentPackage()
                     .runCodeGenAndModifyPlugins();
             boolean hasErrorsFromCodeGenAndModify = diagnosticsFromCodeGenAndModify.diagnostics().stream()
                     .anyMatch(d -> DiagnosticSeverity.ERROR.equals(d.diagnosticInfo().severity()));
-            Collection<Diagnostic> compilationDiagnostics = module.get().currentPackage()
+            Collection<Diagnostic> compilationDiagnostics = project.get().currentPackage()
                     .getCompilation().diagnosticResult().diagnostics();
             boolean hasCompilationErrors = compilationDiagnostics.stream()
                     .anyMatch(d -> DiagnosticSeverity.ERROR.equals(d.diagnosticInfo().severity()));
@@ -151,17 +151,17 @@ public class OpenAPIConverterService implements ExtendedLanguageServerService {
                 response.setError("Given Ballerina file contains compilation error(s).");
                 return response;
             }
-            Module defaultModule = module.get().currentPackage().getDefaultModule();
-
+            Module defaultModule = project.get().currentPackage().getDefaultModule();
+            SemanticModel updatedSemanticModel =
+                    project.get().currentPackage().getCompilation().getSemanticModel(defaultModule.moduleId());
             JsonArray specs = new JsonArray();
             for (DocumentId currentDocumentID : defaultModule.documentIds()) {
                 Document document = defaultModule.document(currentDocumentID);
                 Optional<Path> path = defaultModule.project().documentPath(currentDocumentID);
                 Path inputPath = path.orElse(null);
                 SyntaxTree syntaxTree = document.syntaxTree();
-                List<OASResult> oasResults = ServiceToOpenAPIConverterUtils.generateOAS3Definition(module.get(),
-                        syntaxTree, semanticModel.get(), null, false, inputPath);
-
+                List<OASResult> oasResults = ServiceToOpenAPIConverterUtils.generateOAS3Definition(project.get(),
+                        syntaxTree, updatedSemanticModel, null, false, inputPath);
                 generateServiceJson(response, document.syntaxTree().filePath(), oasResults, specs);
             }
             response.setContent(specs);