ballerina-dev-website icon indicating copy to clipboard operation
ballerina-dev-website copied to clipboard

[Improvement]: Documentation comments in samples doesn't follow proper documentation guidlines

Open jsdjayanga opened this issue 8 months ago • 0 comments

Description

The documentation guidelines in https://ballerina.io/learn/style-guide/annotations-documentation-and-comments/#documentation is not followed in sample codes given in https://ballerina.io/learn/test-ballerina-code/mocking/#create-a-test-double

This has to be corrected in all the samples.

Describe your problem(s)

// This function performs a `get` request to the Chuck Norris API and returns a random joke 
// with the name replaced by the provided name or an error if the API invocation fails.
function getRandomJoke(string name) returns string|error {
    Joke joke = check clientEndpoint->get("/random");
    string replacedText = re `Chuck Norris`.replaceAll(joke.value, name);
    return replacedText;
}

Describe your solution(s)

\# This function performs a `get` request to the Chuck Norris API and returns a random joke .
\#
\# \+ name - The name to replace in the joke.
\# \+ return - A random joke with the name replaced by the provided name or an error if the API invocation fails.
function getRandomJoke(string name) returns string|error {
    Joke joke = check clientEndpoint->get("/random");
    string replacedText = re `Chuck Norris`.replaceAll(joke.value, name);
    return replacedText;
}

Related area

-> Other Area

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

jsdjayanga avatar Jun 13 '24 05:06 jsdjayanga