dourong8495 2017-02-27 04:14
浏览 79

golang:swagger REST api文档生成器

I've searched internet but couldn't find a good solution. I'm looking for something that pretty specific - a golang copy of aiohttp_swagger.

That is a Python package which does magical things. In the endpoint handler method, one write some comment code and it'll be automatically parsed and generates swagger documentation. When the server is up and running, a special URL /api/doc handler will be inserted into the server where people can see it live.

I understand it's tied into the implementation of aiohttp framework and the way Go is used, web framework is not as popular (not using one myself), but I still like that solution very much and would like to find something in the Go land.

So my question is a bit open I guess: is there an equivalent (or rough) of aiohttp_swagger package in Go?

  • 写回答

1条回答 默认 最新

  • dsdxlibt98300 2017-02-27 04:22
    关注

    go-swagger does it based on doc comments: https://goswagger.io/generate/spec.html

    go-restful has a builder for creating swagger 2.0 documents: https://github.com/emicklei/go-restful-openapi

    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号