api.none annotation usage
Description of the api.none annotation provided by hz.
Introduction
The code generated by hz automatically adds a go tag to the struct
, thus facilitating parameter binding.
However, some “fields” of the user structure may not want to participate in the parameter binding or serialization process, so we provide the “api.none” annotation to make the go tag of the generated structure’s “fields” be “-”, thus avoiding parameter binding.
Thrift
Definition:
struct HelloReq{
1: string Hertz (api.none="true");
}
Generated Content:
Protobuf
Definition:
message HelloReq {
optional string Hertz = 1 [(api.none) = "true"];
}
Generated Content:
Last modified
January 14, 2025
: Update release-v0_12_0.md (#1205) (bd11c02)