我们如何指出该字段在 apidocjs 中是可选的/强制的?

How can we point that field is optional / mandate in apidocjs?

我们正在处理 expressJSapidocJS,无法在 table 中定义可选字段。我们想更新字段是否强制,以便用户可以识别参数要求。

示例代码:

 * @apiParam {String} name The User Name.
 * @apiParam {String} email The Email Id.
 * @apiParam {String} password The Users High security Password.
 * @apiParam {String} privilegeRole The Users Privilege Role.
* @apiParam {String} [optional_field] This field is optional.
* @apiParam {String} required_field This is required.

字段名称中的方括号会表示它是可选的 apidoc

[field] - Fieldname with brackets define the Variable as optional.