WSDescription
Describes the REST function, parameters, and return values.
Syntax
WSDescription=" description "
Where:
- description provides a description of the parameter, function, or return value it is applied to.
WSDescription
is an optional attribute.
Usage
You use this attribute to provide useful description for parameters in the function. You can set
WSDescription
on:- Any input and output parameter of a REST operation.
- The attribute clause of the function.
Information you specify with this attribute, is generated for the function in the OpenAPI
specification file. You can control generation of descriptions in the stub file with the
--comment
option of the fglrestful tool.
Example using WSDescription
TYPE orderType RECORD ... END RECORD
PUBLIC FUNCTION getOrders(
category STRING ATTRIBUTE(WSQuery, WSOptional, WSName="cat",WSDescription="Product category"),
sortfield STRING ATTRIBUTE(WSHeader, WSOptional, WSName="sortfld",WSDescription="Sort field"),
popbrand STRING ATTRIBUTE(WSCookie, WSOptional, WSName = "popbrand",WSDescription="Most popular brand"))
ATTRIBUTES (WSGet,
WSPath = "/orders",
WSDescription = "Fetches orders from the resource with the optional filter value(s) applied.",
WSScope = "officestore.user",
WSThrows = "404:Not Found,500:Internal Server Error")
RETURNS (DYNAMIC ARRAY ATTRIBUTE(WSName = "Orders") OF orderType ATTRIBUTES(XMLName = "order",
WSMedia = "application/xml") )
DEFINE orderList DYNAMIC ARRAY OF orderType
# ... function code to get orders ...
RETURN orderList
END FUNCTION