Code review comment: ```suggestion                 if (operation.getParameters() != null && operation.getParameters().size() > 0) { ```

Code under review:
private void setPaths(OpenAPI openAPI) throws BallerinaOpenApiException {
        if (openAPI.getPaths() == null) {
            return;
        }

        this.paths = new LinkedHashSet<>();
        Paths pathList = openAPI.getPaths();
        for (Map.Entry<String, PathItem> path : pathList.entrySet()) {
            setPathName(path.getKey());
            BallerinaPath balPath = new BallerinaPath().buildContext(path.getValue(), openAPI);
            if (balPath.isNoOperationsForPath()) {
                balPath.setResourceName(escapeIdentifier(path.getKey()));
            } else {
                balPath.getOperations().forEach(operation -> {
                    if (operation.getValue().getOperationId() == null) {
                        String pathName = path.getKey().substring(1); 
                        String operationId = operation.getKey() + StringUtils.capitalize(pathName);
                        operation.getValue().setOperationId(escapeIdentifier(CodegenUtils.normalizeForBIdentifier(
                                operationId)));
                    } else {
                        String opId = operation.getValue().getOperationId();
                        operation.getValue().setOperationId(escapeIdentifier(opId));
                    }
                });
            }
            String resourcePath;
            
            if (hasPathParams(path.getValue())) {
                resourcePath = "string `" + path.getKey().replace("{", "${") + "`";
            } else {
                resourcePath = "\"" + path.getKey() + "\"";
            }
            paths.add(new AbstractMap.SimpleEntry<>(resourcePath, balPath));
        }
    }

    /**
     * Checks if there are any path parameters in the operations.
     * @param path  The path item in the OpenAPI spec.
     * @return True if there are path parameters, else false.
     */
    private boolean hasPathParams(PathItem path) {
        if (null != path.getParameters() && path.getParameters().size() > 0) {
            return path.getParameters().stream()
                    .anyMatch(parameter -> null != parameter.getIn() && parameter.getIn().equals("path"));
        }
        if (path.readOperations().size() > 0) {
            return path.readOperations().stream().anyMatch(operation -> {
                if (null != operation.getParameters() && operation.getParameters().size() > 0) {
                    return operation.getParameters().stream()
                            .anyMatch(parameter -> null != parameter.getIn() && parameter.getIn().equals("path"));
                }
                return false;
            });
        }
        return false;
    }

    /**
     * Populate schemas into a "Set".
     *
     * @param openAPI <code>OpenAPI</code> definition object with schema definition
     */
    private void setSchemas(OpenAPI openAPI) {
        this.schemas = new LinkedHashSet<>();
        Map<String, Schema> schemaMap;
        if (openAPI.getComponents() == null || openAPI.getComponents().getSchemas() == null) {
            return;
        }

        schemaMap = openAPI.getComponents().getSchemas();
        for (Map.Entry<String, Schema> entry : schemaMap.entrySet()) {
            try {
                BallerinaSchema schema = new BallerinaSchema().buildContext(entry.getValue(), openAPI);

                
                if (StringUtils.isEmpty(schema.getType())) {
                    schema.setType(entry.getKey());
                }

                schemas.add(new AbstractMap.SimpleEntry<>(entry.getKey(), schema));
            } catch (BallerinaOpenApiException e) {
                
            }
        }
    }

    /**
     * Extract endpoint information from OpenAPI server list.
     * If no servers were found, default {@link BallerinaServer} will be set as the server
     *
     * @param openAPI <code>OpenAPI</code> definition object with server details
     * @throws BallerinaOpenApiException on failure to parse {@code Server} list
     */
    private void setServers(OpenAPI openAPI) throws BallerinaOpenApiException {
        this.servers = new ArrayList<>();
        List<Server> serverList = openAPI.getServers();
        if (serverList == null) {
            BallerinaServer server = new BallerinaServer().getDefaultValue();
            servers.add(server);
            return;
        }

        serverList.forEach(server -> {
            try {
                
                
                
                BallerinaServer balServer = new BallerinaServer().buildContext(server);
                servers.add(balServer);
            } catch (BallerinaOpenApiException e) {
                
                servers.add(new BallerinaServer().getDefaultValue());
            }
        });
    }

    /**
     * Extract security requirements as a set.
     *
     * @param openAPI <code>OpenAPI</code> definition object with security definition
     */
    private void setSecurityRequirements(OpenAPI openAPI) {
        this.security = new LinkedHashSet<>();
        List<SecurityRequirement> requirements = openAPI.getSecurity();
        if (requirements == null || requirements.isEmpty()) {
            return;
        }

        requirements.forEach(r -> r.forEach((key, value) -> {
            Map.Entry entry = new AbstractMap.SimpleEntry<>(key, value);
            security.add(entry);
        }));
    }

    public BallerinaOpenApi srcPackage(String srcPackage) {
        if (srcPackage != null) {
            this.srcPackage = srcPackage.replaceFirst("\\.", "/");
        }
        return this;
    }

    public BallerinaOpenApi modelPackage(String modelPackage) {
        if (modelPackage != null) {
            this.modelPackage = modelPackage.replaceFirst("\\.", "/");
        }
        return this;
    }

    public String getSrcPackage() {
        return srcPackage;
    }

    public String getModelPackage() {
        return modelPackage;
    }

    public String getOpenapi() {
        return openapi;
    }

    public Info getInfo() {
        return info;
    }

    public ExternalDocumentation getExternalDocs() {
        return externalDocs;
    }

    public List<BallerinaServer> getServers() {
        return servers;
    }

    public Set<Map.Entry<String, String>> getSecurity() {
        return security;
    }

    public List<Tag> getTags() {
        return tags;
    }

    public Set<Map.Entry<String, BallerinaPath>> getPaths() {
        return paths;
    }

    public Components getComponents() {
        return components;
    }

    public Map<String, Object> getExtensions() {
        return extensions;
    }

    public Set<Map.Entry<String, BallerinaSchema>> getSchemas() {
        return schemas;
    }

    public void setDefinitionPath(String definitionPath) {
        this.definitionPath = definitionPath;
    }

    public String getDefinitionPath() {
        return definitionPath;
    }

    public static void setPathName(String pathName) {
        BallerinaOpenApi.pathName = pathName;
    }

    public static String getPathName() {
        return  pathName;
    }

}

Line commented on: if (null != operation.getParameters() && operation.getParameters().size() > 0) {

Revised code:
private void setPaths(OpenAPI openAPI) throws BallerinaOpenApiException {
        if (openAPI.getPaths() == null) {
            return;
        }

        this.paths = new LinkedHashSet<>();
        Paths pathList = openAPI.getPaths();
        for (Map.Entry<String, PathItem> path : pathList.entrySet()) {
            setPathName(path.getKey());
            BallerinaPath balPath = new BallerinaPath().buildContext(path.getValue(), openAPI);
            if (balPath.isNoOperationsForPath()) {
                balPath.setResourceName(escapeIdentifier(path.getKey()));
            } else {
                balPath.getOperations().forEach(operation -> {
                    if (operation.getValue().getOperationId() == null) {
                        String pathName = path.getKey().substring(1); 
                        String operationId = operation.getKey() + StringUtils.capitalize(pathName);
                        operation.getValue().setOperationId(escapeIdentifier(CodegenUtils.normalizeForBIdentifier(
                                operationId)));
                    } else {
                        String opId = operation.getValue().getOperationId();
                        operation.getValue().setOperationId(escapeIdentifier(opId));
                    }
                });
            }
            String resourcePath;
            
            if (hasPathParams(path.getValue())) {
                resourcePath = "string `" + path.getKey().replace("{", "${") + "`";
            } else {
                resourcePath = "\"" + path.getKey() + "\"";
            }
            paths.add(new AbstractMap.SimpleEntry<>(resourcePath, balPath));
        }
    }

    /**
     * Checks if there are any path parameters in the operations.
     * @param path  The path item in the OpenAPI spec.
     * @return True if there are path parameters, else false.
     */
    private boolean hasPathParams(PathItem path) {
        if (path.getParameters() != null && !path.getParameters().isEmpty()) {
            return path.getParameters().stream().anyMatch(parameter -> parameter.getIn() != null && parameter.getIn()
                    .equals(GeneratorConstants.PATH));
        }
        if (path.readOperations().isEmpty()) {
            return false;
        }
        return path.readOperations().stream().anyMatch(operation -> {
            if (operation.getParameters() != null && !operation.getParameters().isEmpty()) {
                return operation.getParameters().stream().anyMatch(parameter -> parameter.getIn() != null &&
                        parameter.getIn().equals(GeneratorConstants.PATH));
            }
            return false;
        });
    }
    /**
     * Populate schemas into a "Set".
     *
     * @param openAPI <code>OpenAPI</code> definition object with schema definition
     */
    private void setSchemas(OpenAPI openAPI) {
        this.schemas = new LinkedHashSet<>();
        Map<String, Schema> schemaMap;
        if (openAPI.getComponents() == null || openAPI.getComponents().getSchemas() == null) {
            return;
        }

        schemaMap = openAPI.getComponents().getSchemas();
        for (Map.Entry<String, Schema> entry : schemaMap.entrySet()) {
            try {
                BallerinaSchema schema = new BallerinaSchema().buildContext(entry.getValue(), openAPI);

                
                if (StringUtils.isEmpty(schema.getType())) {
                    schema.setType(entry.getKey());
                }

                schemas.add(new AbstractMap.SimpleEntry<>(entry.getKey(), schema));
            } catch (BallerinaOpenApiException e) {
                
            }
        }
    }

    /**
     * Extract endpoint information from OpenAPI server list.
     * If no servers were found, default {@link BallerinaServer} will be set as the server
     *
     * @param openAPI <code>OpenAPI</code> definition object with server details
     * @throws BallerinaOpenApiException on failure to parse {@code Server} list
     */
    private void setServers(OpenAPI openAPI) throws BallerinaOpenApiException {
        this.servers = new ArrayList<>();
        List<Server> serverList = openAPI.getServers();
        if (serverList == null) {
            BallerinaServer server = new BallerinaServer().getDefaultValue();
            servers.add(server);
            return;
        }

        serverList.forEach(server -> {
            try {
                
                
                
                BallerinaServer balServer = new BallerinaServer().buildContext(server);
                servers.add(balServer);
            } catch (BallerinaOpenApiException e) {
                
                servers.add(new BallerinaServer().getDefaultValue());
            }
        });
    }

    /**
     * Extract security requirements as a set.
     *
     * @param openAPI <code>OpenAPI</code> definition object with security definition
     */
    private void setSecurityRequirements(OpenAPI openAPI) {
        this.security = new LinkedHashSet<>();
        List<SecurityRequirement> requirements = openAPI.getSecurity();
        if (requirements == null || requirements.isEmpty()) {
            return;
        }

        requirements.forEach(r -> r.forEach((key, value) -> {
            Map.Entry entry = new AbstractMap.SimpleEntry<>(key, value);
            security.add(entry);
        }));
    }

    public BallerinaOpenApi srcPackage(String srcPackage) {
        if (srcPackage != null) {
            this.srcPackage = srcPackage.replaceFirst("\\.", "/");
        }
        return this;
    }

    public BallerinaOpenApi modelPackage(String modelPackage) {
        if (modelPackage != null) {
            this.modelPackage = modelPackage.replaceFirst("\\.", "/");
        }
        return this;
    }

    public String getSrcPackage() {
        return srcPackage;
    }

    public String getModelPackage() {
        return modelPackage;
    }

    public String getOpenapi() {
        return openapi;
    }

    public Info getInfo() {
        return info;
    }

    public ExternalDocumentation getExternalDocs() {
        return externalDocs;
    }

    public List<BallerinaServer> getServers() {
        return servers;
    }

    public Set<Map.Entry<String, String>> getSecurity() {
        return security;
    }

    public List<Tag> getTags() {
        return tags;
    }

    public Set<Map.Entry<String, BallerinaPath>> getPaths() {
        return paths;
    }

    public Components getComponents() {
        return components;
    }

    public Map<String, Object> getExtensions() {
        return extensions;
    }

    public Set<Map.Entry<String, BallerinaSchema>> getSchemas() {
        return schemas;
    }

    public void setDefinitionPath(String definitionPath) {
        this.definitionPath = definitionPath;
    }

    public String getDefinitionPath() {
        return definitionPath;
    }

    public static void setPathName(String pathName) {
        BallerinaOpenApi.pathName = pathName;
    }

    public static String getPathName() {
        return  pathName;
    }

}