-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api request json body data type support interface{} #2888
Comments
.api文件中可以使用interface数据类型,实际在请求过程中会报错:type mismatch |
The interface data type can be used in the .api file, but an error will be reported during the request process: type mismatch |
@yasin-wu 我们是通过直接修改生成的 |
@yasin-wu We directly modify the generated |
我的做法是让接口调用方把数据json序列化一遍,传字符串,收到字符串再反序列化成自己想要的结构体 |
My approach is to let the interface caller serialize the data json again, pass the string, receive the string and then deserialize it into the desired structure |
遇到了同样的问题,业务里面有需要 interface{} 作为动态的参数结构体 |
Encountered the same problem. There is a need for interface{} as a dynamic parameter structure in the business. |
请问这个部分有其他解法吗?不自己修改handle的情况下 能不能就用go-zero的httpx parse解析 |
Is there any other solution to this part? Without modifying the handle myself, can I use go-zero's httpx parse to parse it? |
core/mapping/unmarshaler.go
The text was updated successfully, but these errors were encountered: