Documentation comments
harnyk opened this issue · 3 comments
harnyk commented
I would like if the following struct:
// Header Item
type HeaderItem struct {
//Header name
Name string `json:"name"`
//Header value
Value string `json:"value"`
}would convert to the following interface
/**
* Header Item
*/
interface HeaderItem {
/**
* Header name
*/
name: string;
/**
* Header value
*/
value: string;
}Is it possible? Other option would be to have a special tag:
type HeaderItem struct {
Name string `json:"name" doc:"Header name"`
Value string `json:"value" doc:"Header value"`
_ struct{} `doc:"Header Item"`
}gzuidhof commented
This library won't be able to support this as it's reflection based, you could consider using tygo instead.
tkrajina commented
tkrajina commented
@harnyk Added a way to specify field comments, see https://github.com/tkrajina/typescriptify-golang-structs#field-comments