@@ -124,15 +124,18 @@ service userExample {
124124 }
125125}
126126
127+
127128// Some notes on defining fields under message:
128129// (1) Fill in the validate rules https://github.com/envoyproxy/protoc-gen-validate#constraint-rules
129- // (2) When using the protoc-gen-openapiv2 plugin, if the defined fields are snake case,
130- // you must add annotations for snake case names, such as string foo_bar = 1 [json_name = "foo_bar"],
130+ // (2) Suggest using camel hump naming for message field names, and for names ending in 'id',
131+ // use xxxID naming format, such as userID, orderID, etc.
132+ // (3) When using the protoc-gen-openapiv2 plugin, if the defined fields are snake case,
133+ // you must add annotations for snake case names, such as string fieldName = 1 [json_name = "field_name"],
131134// to ensure that the front end and back end JSON naming is consistent.
132- // (3 ) If the route contains the path parameter, such as /api/v1/userExample/{id}, the defined
135+ // (4 ) If the route contains the path parameter, such as /api/v1/userExample/{id}, the defined
133136// message must contain the name of the path parameter and the name should be
134137// added with a new tag, such as int64 id = 1 [(tagger.tags) = "uri:\"id\""];
135- // (4 ) If the request url is followed by a query parameter, such as /api/v1/getUserExample?name=Tom,
138+ // (5 ) If the request url is followed by a query parameter, such as /api/v1/getUserExample?name=Tom,
136139// a form tag must be added when defining the query parameter in the message,
137140// such as string name = 1 [(tagger.tags) = "form:\"name\""].
138141
0 commit comments