2

一个更漂亮的Swagger界面——RapiDoc

 3 years ago
source link: https://www.cnblogs.com/TianFang/p/14608481.html
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.

今天看了一下有人推荐了一个swagger的UI RapiDoc,确实非常漂亮的。

试了一下,集成是非常简单的:本身只有一个js文件,只要本地开启了swagger-doc后,引入js,指定swagger scheme路径即可:

<!doctype html> <!-- Important: must specify -->
<html>
    <head>
        <meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 charecters -->
        <script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
    </head>
    <body>
        <rapi-doc spec-url = "/swagger/v1/swagger.json"> </rapi-doc>
    </body>
</html>

它也支持集成到React和Vue中,并且提供了许多高级定制的选项,以后估计就用它代替标准的swagger的界面了。

参考文档:

  • https://mrin9.github.io/RapiDoc/
  • https://mrin9.github.io/RapiDoc/quickstart.html

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK