Ballerina V 1.0 - Error in Calling function with jdbc:Client return type - undocumented return parameter

荒凉一梦 提交于 2019-12-11 04:53:20

问题


I need to call a function in test.bal. Function is written in function.bal file in the same module. Return type of the function is jdbc:Client.

function.bal :

import ballerinax/java.jdbc;

public function createDbConn() returns jdbc:Client{
    jdbc:Client testDbConn = new({
    url: "jdbc:mysql://localhost:3306/testDB",
    username: "testUsername",
    password: "testPassword",
    poolOptions: {maximumPoolSize: 5},
    dbOptions: {useSSL: false}
    });
return testDbConn;
}

Before invoking this method in test.bal, there's no compilation error. Then I'm trying to invoke the function in test.bal as below

jdbc:Client testDbConn = createDbConn();

...//more code in here
var selectFromDb = testDbConn->select("SELECT * FROM test", testData);

After method invoking, this gives a compile error as follows in function.bal

undocumented return parameter

What's the reason for this error? Can't I use jdbc:Client as the return type?

PS: This is a warning, not a compile error


回答1:


undocumented return parameter

should be a warning, this is when you have incomplete function documentation.

But mere invocation of the function should not produce this kind of documentation warning.

Can you try adding method return documentation to that method.

# + return - This is the description of the return value of
#            the `doThatOnObject` function.

See Ballerina doc comment examples here.

If the error still persists please report a bug at https://github.com/ballerina-platform/ballerina-lang/issues



来源:https://stackoverflow.com/questions/58300618/ballerina-v-1-0-error-in-calling-function-with-jdbcclient-return-type-undoc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!