简体   繁体   English

将swagger-ui输出保存到文件中

[英]Save swagger-ui output to a file

I have an application that provide some REST API. 我有一个提供一些REST API的应用程序。 This API can be changed from version to version. 此API可以从版本更改为版本。 I want to maintain change log, but it is difficult to remember all api-changes and log them by hand. 我想维护更改日志,但很难记住所有api-changes并手动记录它们。 I have a swagger-ui and i can see mi API any time i need it: 我有一个swagger-ui,我可以在任何需要的时候看到mi API:

Swagger UI imgur

My idea is to save (some way) this output to file every time new version is released and then analyze it using some diff utility. 我的想法是每次发布新版本时将此输出保存(以某种方式)到文件,然后使用一些diff实用程序对其进行分析。

So the question is: how i can save my API (which I see on the screen) to a file? 所以问题是:我如何将我的API(我在屏幕上看到)保存到文件中?

You could save the json file (typically what is in the text box in the header) and do a diff on that. 您可以保存json文件(通常是标题中文本框中的内容)并对其进行差异处理。

If that url doesn't contain the json, append /swagger.json 如果该url不包含json,请追加/swagger.json

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM