8

golang 有好的根据 struct 生成 jsonschema 的库吗?

 2 years ago
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.
neoserver,ios ssh client

golang 有好的根据 struct 生成 jsonschema 的库吗?

V2EX  ›  Go 编程语言

golang 有好的根据 struct 生成 jsonschema 的库吗?

  livenux · 1 天前 · 788 次点击
想根据 struct 生成 jsonschema 然后然后对 json 进行校验,但是看了一圈只在 github 找到一个根据 struct 生成 jsonschema 的,有点简陋。
https://github.com/alecthomas/jsonschema
3 条回复    2021-12-19 21:56:30 +08:00

dcoder

dcoder      1 天前

golang struct 能设置的部分比 jsonschema 少, 不知道能有好的这方面 lib 不.
同关注

janxin

janxin      19 小时 47 分钟前

巧了,我前两天刚刚找过,作为 Schema-First 开发过度我在用这个生成 jsonschema 然后做校验

https://pkg.go.dev/github.com/swaggest/jsonschema-go

不过需求不一样,你可以看一下是否满足需求。另外你这样性能损耗比较大...

kwanzaa

kwanzaa      15 小时 55 分钟前

Copilot 一边写一边提示

关于   ·   帮助文档   ·   API   ·   FAQ   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   3887 人在线   最高记录 5497   ·  

创意工作者们的社区

World is powered by solitude

VERSION: 3.9.8.5 · 16ms · UTC 05:51 · PVG 13:51 · LAX 21:51 · JFK 00:51
♥ Do have faith in what you're doing.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK