Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write "javadoc" statements in Thrift IDL?

Tags:

thrift

Thrift has a html generator:

(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.

If write a struct like this

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

running thrift --gen html creates an html page with part like this:

Struct MyStruct

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

This is description of struct MyStruct

But I don't found how to fill description field?

like image 256
jonua Avatar asked Jun 21 '16 20:06

jonua


1 Answers

Great question, this is hard to guess and not super well documented (yes I'm being generous). Here's the answer:

struct MyStruct {
     /** This is how you add a description to a struct field */
     1: required i32 fieldOne = 2
}
like image 111
codeSF Avatar answered Jan 01 '23 08:01

codeSF