8
golang 有好的根据 struct 生成 jsonschema 的库吗?
source link: https://www.v2ex.com/t/823094
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
golang 有好的根据 struct 生成 jsonschema 的库吗?
想根据 struct 生成 jsonschema 然后然后对 json 进行校验,但是看了一圈只在 github 找到一个根据 struct 生成 jsonschema 的,有点简陋。
https://github.com/alecthomas/jsonschema
https://github.com/alecthomas/jsonschema
3 条回复 • 2021-12-19 21:56:30 +08:00
dcoder 1 天前
golang struct 能设置的部分比 jsonschema 少, 不知道能有好的这方面 lib 不.
同关注
同关注
janxin 19 小时 47 分钟前
巧了,我前两天刚刚找过,作为 Schema-First 开发过度我在用这个生成 jsonschema 然后做校验
https://pkg.go.dev/github.com/swaggest/jsonschema-go
不过需求不一样,你可以看一下是否满足需求。另外你这样性能损耗比较大...
https://pkg.go.dev/github.com/swaggest/jsonschema-go
不过需求不一样,你可以看一下是否满足需求。另外你这样性能损耗比较大...
kwanzaa 15 小时 55 分钟前
Copilot 一边写一边提示
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK