如何写" javadoc" Thrift IDL中的陈述?

时间:2016-06-21 20:20:41

标签: thrift

Thrift有一个 html 生成器:

thrift --help

html (HTML):
standalone:      Self-contained mode, includes all CSS in the HTML files.
                 Generates no style.css file, but HTML files will be larger.

如果像这样写一个struct

/**
* This is description of struct MyStruct
**/
struct MyStruct {
    1: required i32 fieldOne = 2
}

运行thrift --gen html会创建一个html页面,其中包含以下部分:

Struct MyStruct

|Key|Field   |Type|Description|Requiredness|Default value|
|---|--------|----|-----------|------------|-------------|
|1  |fieldOne|i32 |           |required    |2            |

This is description of struct MyStruct

但我还没有找到如何填写description字段?

1 个答案:

答案 0 :(得分:5)

很好的问题,这很难猜测,也没有超级记录(是的,我很慷慨)。这是答案:

struct MyStruct {
     /** This is how you add a description to a struct field */
     1: required i32 fieldOne = 2
}