From 655b6d3a215a7a74c4e4987f1508086635d3a374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Mon, 31 Mar 2025 22:04:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=81=9A=E5=90=88=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E7=BB=93=E6=9E=9Cjson=20tag=E6=9C=AA=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- httpclient/mesh/mesh.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/httpclient/mesh/mesh.go b/httpclient/mesh/mesh.go index 20b1e0c..daf39d3 100644 --- a/httpclient/mesh/mesh.go +++ b/httpclient/mesh/mesh.go @@ -83,8 +83,9 @@ func (c *client) Request() *Response { respByte := serialize.JSON.MarshalForByteIgnoreError(c.resp.AliasResultTable) fieldList := make([]validate.StructField, 0) for _, item := range c.reqCfg.ResultRule { + pathArr := strings.Split(item.DataPath, ".") fieldList = append(fieldList, validate.StructField{ - JsonTag: "", + JsonTag: pathArr[len(pathArr)-1], Type: item.DataType, Required: false, RuleList: nil,