<p>I have a project that uses httprouter and net/http and I want to setup swagger annotations in this existing project to generate godocs.</p>
<p>I looked it go swagger and a couple of other libraries but I'm confused how to go about it and it seems to generate code based on the API.</p>
<p>I want something like in java, you put annotations in comments and there is a way to generate the API page from those</p>
<hr/>**评论:**<br/><br/>dlsniper: <pre><p>Have a look at <a href="https://github.com/go-swagger/go-swagger" rel="nofollow">https://github.com/go-swagger/go-swagger</a></p>
<p>One of the examples is how to do what you need, if I understand you correctly. </p>
<p>Hope it helps.</p></pre>brokenprogram: <pre><p>At the time I've tried swagger it was a mess. I think the main issue was that the schema was basically a description of the implementation(mainly the Java implementation) so it didn't map well for other languages. Many things didn't really make sense. I ended-up developing a custom solution using json-hyperschema.</p></pre>
Has anyone implemented go swagger to generate api docs for an existing go service?
polaris · · 511 次点击这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传